-
-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
npm root -g should be the correct global node_module path? #7
Comments
Hi @lcxfs1991, I'm also using Do you have any code examples that show you are getting an error or different results? Also, if you could provide details about the OS, node version, and npm version, it'll help us determine if there is a bug or not. |
Hello, I have the same issue when using https://github.com/ekalinin/nodeenv on Windows 10. > node --version
v8.9.4
> npm --version
5.6.0
> npm root -g
C:\test-project\.env\Scripts\node_modules
> where nodejs
C:\test-project\.env\Scripts\nodejs.exe
> where npm
C:\test-project\.env\Scripts\npm.cmd
> nodejs
> require('global-modules');
'C:\\Users\\<MYUSER>\\AppData\\Roaming\\npm\\node_modules' |
@axnsan12 I don't know anything about |
@doowb Is there any reason you're not just running EDIT: I see now that you linked to the node module |
@axnsan12 will you run the following: > nodejs
> console.log(process.env.PATH); |
Sure, here it is: C:\test-project\.env\Scripts;C:\Program Files\Far Manager\ConEmu\Scripts;C:\Program Files\Far Manager;C:\Program Files\Far Manager\ConEmu;C:\Program Files\Docker\Docker\Resources\bin;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler;C:\ProgramData\Oracle\Java\javapath;C:\Python36\Scripts;C:\Python36;C:\Python27\Scripts;C:\Python27;C:\bin\imagemagick;C:\Program Files\MongoDB\Server\3.4\bin;C:\cygwin64\bin;C:\Program Files (x86)\PuTTY;C:\Program Files\Git\cmd;C:\bin;C:\Android\sdk\platform-tools;C:\Android\sdk\tools;C:\Users\axnsan\Application Data\npm;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\ProgramData\chocolatey\bin;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\OpenVPN\bin;C:\Program Files\dotnet;C:\Program Files (x86)\IDA 6.8;C:\Program Files\Calibre2;C:\Windows\System32;C:\Program Files (x86)\Skype\Phone;C:\Go\bin;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\Program Files\Microsoft SQL Server\130\Tools\Binn;C:\Program Files\nodejs\;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit;C:\Ruby24-x64\bin;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Program Files\OpenVPN\bin;C:\Program Files (x86)\PuTTY;C:\Program Files\Git\cmd;C:\Python27\Scripts;C:\Python27;C:\bin;C:\Android\sdk\platform-tools;C:\Android\sdk\tools;C:\Program Files\nodejs\;C:\Users\axnsan\Application Data\npm;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\Users\axnsan\AppData\Local\Microsoft\WindowsApps;C:\texlive\2016\bin\win32;C:\Program Files (x86)\Diffuse;C:\Users\axnsan\AppData\Roaming\npm;C:\Users\axnsan\AppData\Local\GitHubDesktop\bin Bonus: > which.sync('npm')
'C:\\test-project\\.env\\Scripts\\npm.CMD'
> which.sync('nodejs')
'C:\\test-project\\.env\\Scripts\\nodejs.EXE'
> require('global-modules');
'C:\\Users\\axnsan\\AppData\\Roaming\\npm\\node_modules' (the expected path would be |
Thanks, I don't have access to an environment setup like yours and that's why I'm asking for this information. I might have to look into this more, but the main logic is in global-prefix. The Maybe the correct way is to check if the If you could go to |
Seems like there is a similar issue for macOS users who follow these official instructions: Running |
Seriously? |
Hi, I found that the result from
npm root -g
should be the correct path. However sometimes global-modules will find the wrong one when we use nvm to manage our node versions.Do you have any ideas?
The text was updated successfully, but these errors were encountered: