Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

5.6.0xb3 node_modules missing

Discussion in 'Linux' started by benjigga, Jan 6, 2017.

  1. benjigga

    benjigga

    Joined:
    Nov 16, 2013
    Posts:
    8
    First time trying to run Unity Editor in Linux, and on the first launch it hangs on the "gettingStarted" / "recent" window and pegs my CPU to 100%. I'm using Ubuntu 16.04, with NPM 3.5.8, Node 4.2.6, Java 8 all set on the PATH. I installed Unity through the Ubuntu Software Center.

    My Editor.log is outputting that it can't find a node module:

    Code (CSharp):
    1. mono profile = '/opt/Unity/Editor/Data/Mono/lib/mono/2.0'
    2. Initialize mono
    3. Mono path[0] = '/opt/Unity/Editor/Data/Managed'
    4. Mono path[1] = '/opt/Unity/Editor/Data/Mono/lib/mono/2.0'
    5. Mono path[2] = '/opt/Unity/Editor/Data/UnityScript'
    6. Mono path[3] = '/opt/Unity/Editor/Data/Mono/lib/mono/2.0'
    7. Mono config path = '/opt/Unity/Editor/Data/Mono/etc'
    8. Using monoOptions --debugger-agent=transport=dt_socket,embedding=1,defer=y,address=0.0.0.0:56502
    9. Desktop is 2736 x 1824 @ 60 Hz
    10. module.js:328
    11.     throw err;
    12.     ^
    13.  
    14. Error: Cannot find module '/opt/Unity/Editor/Data/Tools/nodejs/bin/node_modules/npm/bin/npm-cli.js'
    15.     at Function.Module._resolveFilename (module.js:326:15)
    16.     at Function.Module._load (module.js:277:25)
    17.     at Function.Module.runMain (module.js:442:10)
    18.     at startup (node.js:136:18)
    19.     at node.js:966:3
    20. ListPackages failed, output:
    21. Error parsing output of npm ls (1) @0 output:
    22. module.js:328
    23.     throw err;
    24.     ^
    25.  
    26. Error: Cannot find module '/opt/Unity/Editor/Data/Tools/nodejs/bin/node_modules/npm/bin/npm-cli.js'
    27.     at Function.Module._resolveFilename (module.js:326:15)
    28.     at Function.Module._load (module.js:277:25)
    29.     at Function.Module.runMain (module.js:442:10)
    30.     at startup (node.js:136:18)
    31.     at node.js:966:3
    32. InstallEditorPackages failed, output:
    33. installJavascriptPackages failed
    34. (Filename: /home/builduser/buildslave/unity/build/Runtime/Utilities/Argv.cpp Line: 172)
    35.  
    36. [0105/215659:ERROR:browser_main_loop.cc(161)] Running without the SUID sandbox! See https://code.google.com/p/chromium/wiki/LinuxSUIDSandboxDevelopment for more information on developing with the sandbox on.
    37. ATTENTION: default value of option force_s3tc_enable overridden by environment.
    38. [0105/215659:ERROR:renderer_main.cc(227)] Running without renderer sandbox
    39. [0105/215659:ERROR:gpu_process_transport_factory.cc(402)] Failed to establish GPU channel.
    40. Error loading file:///%2Fhome%2Fben%2F.local%2Fshare%2Funity3d%2FPackages%2Fnode_modules%2Funity-editor-home%2Fdist/index.html#/gettingStarted
    41.  
    42. (Filename: /home/builduser/buildslave/unity/build/Editor/Platform/Interface/NativeWebViewWindow.cpp Line: 51)
    There is no node_modules directory in /opt/Unity/Editor/Data/Tools/nodejs/bin. Do I need to do something to have Unity install its NPM dependencies? Or is there something else wrong here?

    I've checked that my user has ownership of all the unity3d directories in ~/.cache ~/.config and ~/.local. And I've made sure ~/.local/share/unity3d/Packages exists. User root is the owner of /opt/Unity

    Any suggestions?
     
  2. chase-cobb

    chase-cobb

    Joined:
    Aug 16, 2011
    Posts:
    51
    After some mucking around I finally got this to work, but it's not a very elegant solution. I'm on Ubuntu 16.04 and here are the steps :
    • Copy the node_modules directory from "/usr/share/npm" and paste into "/opt/Unity/Editor/Data/Tools/nodejs/bin/"
    • Copy the bin and lib folders from "/usr/share/npm" and paste into "/opt/Unity/Editor/Data/Tools/nodejs/bin/node_modules/npm"
    Again, I am using the nodejs and npm packages as installed by apt, so your directories may differ from mine. Hope this helps.
     
  3. Adnaan

    Adnaan

    Joined:
    Jan 9, 2017
    Posts:
    1
    I have solved it by adding npm-cli.js path in /opt/Unity/Editor/Data/Tools/nodejs/bin/npm file


    Screenshot from 2017-01-10 03-12-45.png
     
    cynepco3hahue and Pavel_D like this.
  4. kkiernan

    kkiernan

    Joined:
    Jan 10, 2017
    Posts:
    1
    Thanks for the help guys. I noticed my missing npm-cli.js file was actually at /opt/Unity/Editor/Data/Tools/nodejs/lib/node_modules/npm/bin/npm-cli.js, so I updated /opt/Unity/Editor/Data/Tools/nodejs/bin/npm to point there, which solved my problem.
     
  5. Pavel_D

    Pavel_D

    Joined:
    Nov 17, 2013
    Posts:
    14
    Best, used your fix, and it worked for me, Special Thanks)
     
  6. Durazell

    Durazell

    Joined:
    Sep 28, 2013
    Posts:
    9
    This fixed black screen on startup problem on Antergos, except the path was different.
     
  7. cynepco3hahue

    cynepco3hahue

    Joined:
    Jan 26, 2017
    Posts:
    1
    A lot of thanx Adnaan it was helpful also for Fedora.
     
  8. asvany

    asvany

    Joined:
    Jul 16, 2016
    Posts:
    1
    on Ubuntu 16 install the "nodejs-legacy"
     
  9. LevonRavel

    LevonRavel

    Joined:
    Feb 26, 2014
    Posts:
    177