I'm trying to build a new NS8 project. I have another NS6.5 project on my computer, but it's in a different folder. When running npm install -g nativescript in a different folder, I get the following error
2323 verbose argv "/Users/.../.nvm/versions/node/v16.4.0/bin/node" "/Users/.../.nvm/versions/node/v16.4.0/bin/npm" "install" "-g" "nativescript"
2324 verbose node v16.4.0
2325 verbose npm v7.18.1
2326 error code ENOENT
2327 error syscall lstat
2328 error path /Users/.../.npm/_cacache/content-v2/sha1/07/e1/3c3118154c53893d3be7a7e08d990e86d859
2329 error errno -2
2330 error enoent ENOENT: no such file or directory, lstat '/Users/.../.npm/_cacache/content-v2/sha1/07/e1/3c3118154c53893d3be7a7e08d990e86d859'
2331 error enoent This is related to npm not being able to find a file.
2332 verbose exit -2
I'm not sure why this is erroring out. Any help would be appreciated. Thanks
I solved this by installing node version 14.17.1 (v6.14.13)
Related
When upgrading to newer versions of npm from 6.14 to latest on react native project
Using node 14, nvm to switch node versions, ideally i'd like to go to node 16, but a similar issue happens regardless of 14 or 16 when updating npm in particular.
I'm also using homebrew on mac M1
I notice the Jetify command asks me:
Jetifier found 1390 file(s) to forward-jetify. Using 8 workers...
Need to install the following packages:
pod
Ok to proceed? (y)
when i select y, npm i fails. I've cleared cache's and removed node_modules. normal cache clearing attempts don't seem to work.
npm ERR! code ENOENT
npm ERR! syscall chmod
npm ERR! path /Users/user/.npm/_npx/a0ca5f5666585aa2/node_modules/pod/node_modules/pm2/bin/pm2
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, chmod '/Users/user/.npm/_npx/a0ca5f5666585aa2/node_modules/pod/node_modules/pm2/bin/pm2'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/user/.npm/_logs/2022-01-28T21_51_28_303Z-debug-0.log
npm ERR! code 254
npm ERR! path /Users/user/repos/MyApp/My-MobileApp
npm ERR! command failed
npm ERR! command sh -c npx jetify && cd ios && npx pod install && cd .. && ./node_modules/.bin/patch-package
Here is part of the complete log -
3325 timing reify:rollback:retireShallow Completed in 0ms
3326 timing command:exec Completed in 42372ms
3327 verbose stack Error: ENOENT: no such file or directory, chmod '/Users/user/.npm/_npx/a0ca5f5666585aa2/node_modules/pod/node_modules/pm2/bin/pm2'
3328 verbose cwd /Users/user/repos/MyApp/MyApp-MobileApp/ios
3329 verbose Darwin 21.2.0
3330 verbose argv "/Users/user/.nvm/versions/node/v14.18.3/bin/node" "/Users/user/.nvm/versions/node/v14.18.3/lib/node_modules/npm/bin/npm-cli.js" "exec" "--" "pod" "install"
3331 verbose node v14.18.3
3332 verbose npm v8.4.0
3333 error code ENOENT
3334 error syscall chmod
3335 error path /Users/user/.npm/_npx/a0ca5f5666585aa2/node_modules/pod/node_modules/pm2/bin/pm2
3336 error errno -2
3337 error enoent ENOENT: no such file or directory, chmod '/Users/user/.npm/_npx/a0ca5f5666585aa2/node_modules/pod/node_modules/pm2/bin/pm2'
3338 error enoent This is related to npm not being able to find a file.
3338 error enoent
3339 verbose exit -2
3340 timing npm Completed in 42533ms
3341 verbose unfinished npm timer reify 1643406718315
3342 verbose unfinished npm timer reify:build 1643406730346
3343 verbose unfinished npm timer build 1643406730346
3344 verbose unfinished npm timer build:deps 1643406730347
3345 verbose unfinished npm timer build:link 1643406730354
3346 verbose unfinished npm timer build:link:node_modules/pod 1643406730356
3347 verbose code -2
3348 error A complete log of this run can be found in:
3348 error /Users/user/.npm/_logs/2022-01-28T21_51_28_303Z-debug-0.log
It looks like the error is related to not finding the pm2 package from pod dependency.
Not sure if this will work properly with npx, you might need to install pod globally to get this working.
npm install pod -g
pod install // instead of npx pod install
https://www.npmjs.com/package/pod#installation
Try npm rebuild they say to use "only when you upgrade the node version and must recompile"
hello i once faced this type of issue and issue was actually because pm2 or some other package or processes on old node which was used in your app wasnt found in the updated node version
Reinstall your pm2 package and other package used by your old node in your code again and try again
let me know if this helps you
I already installed node.js, npm and gulp on my computer (windows 7), but when I'm trying to install gulp on my project's folder with the "npm update --save-dev" commande line, I got an error and I don't know how to fix this. But when I do all these steps on my portable (windows 10) it works perfectly...
Here's the log of the error :
11930 warn test#1.0.0 No repository field.
11931 verbose stack Error: ENOENT: no such file or directory, rename
'G:\Desktop\TFA\node_modules\#gulp-sourcemaps\identity-map\node_modules\source-map' -> 'G:\Desktop\TFA\node_modules\#gulp-sourcemaps\identity-map\node_modules.source-map.DELETE'
11932 verbose cwd G:\Desktop\TFA
11933 verbose Windows_NT 6.1.7601
11934 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Program
Files\nodejs\node_modules\npm\bin\npm-cli.js" "update" "--save-dev"
11935 verbose node v9.9.0
11936 verbose npm v5.6.0
11937 error path G:\Desktop\TFA\node_modules\#gulp-sourcemaps\identity-map\node_modules\source-map
11938 error code ENOENT
11939 error errno -4058
11940 error syscall rename
11941 error enoent ENOENT: no such file or directory, rename 'G:\Desktop\TFA\node_modules\#gulp-sourcemaps\identity-map\node_modules\source-map' -> 'G:\Desktop\TFA\node_modules\#gulp-sourcemaps\identity-map\node_modules.source-map.DELETE'
11942 error enoent This is related to npm not being able to find a file.
11943 verbose exit [ -4058, true ]
My npm installs on windows 10 with the most up to date node.js and npm stable versions always fail when I enter the command npm install while cd'd into my project folder. This specific folder was set up with express as described here. Below is the relevant portion of the verbose failure log. I have no idea what is going wrong, can anyone help?
1315 verbose stack Error: ENOENT: no such file or directory, rename 'C:\Users\carte\Desktop\Queue\Queue\node_modules\amdefine' -> 'C:\Users\carte\Desktop\Queue\Queue\node_modules.amdefine.DELETE'
1316 verbose cwd C:\Users\carte\Desktop\Queue\Queue
1317 verbose Windows_NT 10.0.16299
1318 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Users\carte\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "install" "--verbose"
1319 verbose node v8.11.0
1320 verbose npm v5.8.0
1321 error path C:\Users\carte\Desktop\Queue\Queue\node_modules\amdefine
1322 error code ENOENT
1323 error errno -4058
1324 error syscall rename
1325 error enoent ENOENT: no such file or directory, rename 'C:\Users\carte\Desktop\Queue\Queue\node_modules\amdefine' -> 'C:\Users\carte\Desktop\Queue\Queue\node_modules.amdefine.DELETE'
1326 error enoent This is related to npm not being able to find a file.
1327 verbose exit [ -4058, true ]
I know this is old, but I had currently this problem and couldn't find answers, so I post my solution, in case it helps someone else.
My problem was that I have npm install on C:\ and my project (or git folder) in G:\.
Moving my folder from G:\ to C:\Desktop and running npm install solved it for me.
I am not sure if it was because of moving it to C:\ or if it was because of moving it outside git-folder.
Edit: before that I actually cleaned npm cached using --force.
I'm using npm v6.7.0 and node v10.15.1
which npm version you are using, basically thses errors come with npm version below 5.5. For CLI
supporting information:
npm -v prints: 5.6.0
node -v prints: 8.9.1
npm config get registry prints: https://registry.npmjs.org/
Windows, OS X/macOS, or Linux?: Windows 10
In my case, npm install got stuck because I had TypeScript watching file in this directory. So the solution is to stop any tool that might be watching files and try again to install.
I download a demo "react-redux-demo",and when I use the commond "npm install webpack --save-dev" to install webpack, the error shows.
This is the log
8351 verbose unlock done using C:\Users\user\AppData\Roaming\npm-cache\_locks\staging-51622fc2de18aa59.lock for D:\work\test\react-redux-demo\node_modules\.staging
8352 warn The package history is included as both a dev and production dependency.
8353 warn The package react is included as both a dev and production dependency.
8354 warn The package react-router-config is included as both a dev and production dependency.
8355 warn The package react-router-native is included as both a dev and production dependency.
8356 verbose stack Error: ENOENT: no such file or directory, rename 'D:\work\test\react-redux-demo\node_modules\.staging\loader-utils-21a7d1c0\node_modules\big.js'
-> 'D:\work\test\react-redux-demo\node_modules\.staging\big.js-134af3f2'
8357 verbose cwd D:\work\test\react-redux-demo
8358 verbose Windows_NT
10.0.14393
8359 verbose argv "D:\\Program Files\\nodejs\\node.exe" "D:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "webpack" "--save-dev"
8360 verbose node v8.4.0
8361 verbose npm v5.3.0
8362 error path D:\work\test\react-redux-demo\node_modules\.staging\loader-utils-21a7d1c0\node_modules\big.js
8363 error code ENOENT
8364 error errno -4058
8365 error syscall rename
8366 error enoent ENOENT: no such file or directory, rename 'D:\work\test\react-redux-demo\node_modules\.staging\loader-utils-21a7d1c0\node_modules\big.js'
-> 'D:\work\test\react-redux-demo\node_modules\.staging\big.js-134af3f2'
8367 error enoent This is related to npm not being able to find a file.
8368 verbose exit [ -4058, true ]
I can't install my private module call storage:0.1.1 when I command npm install in the root path.
I write package.json to install this module as:
"dependencies": {
"storage": "file:modules/storage"
}
And I also write package.json in the private module stroage already, it's work on my linux well, on windows well before, but one day I install occur error -4058
And there are error message:
909 verbose stack Error: ENOENT: no such file or directory, scandir 'C:\Users\vincent_lin\AppData\Roaming\npm-cache\storage\0.1.1\package.tgz'
909 verbose stack at Error (native)
910 verbose cwd D:\networkteam\meta\git_meta_static_develop
911 error Windows_NT 6.1.7601
912 error argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install"
913 error node v4.4.2
914 error npm v2.15.0
915 error path C:\Users\vincent_lin\AppData\Roaming\npm-cache\storage\0.1.1\package.tgz
916 error code ENOENT
917 error errno -4058
918 error syscall scandir
919 error enoent ENOENT: no such file or directory, scandir 'C:\Users\vincent_lin\AppData\Roaming\npm-cache\storage\0.1.1\package.tgz'
919 error enoent This is most likely not a problem with npm itself 919 error enoent and is related to npm not being able to find a file.
920 verbose exit [ -4058, true ]
PS: I have tried to use powershell with administration and I checked the path
C:\Users\vincent_lin\AppData\Roaming\npm-cache\storage\0.1.1\package.tgz
is correct.
And I ever update npm to latest version, it still exist error.
Thanks for any response.
In Windows you must use \ slash and not / slash.
Please provide relative path starting with a .\
Eg: "dependencies": { "storage": "file:.\modules\storage" }
Or provide the full path starting with the drive letter.