执行npm i命令失败(退出码254),ENOENT找不到tsickle文件求助
npm install fails with ENOENT error on tsickle/src/main.js (exit code 254)
Environment Details
- Ionic: 3.20.0
- Node: v8.10.0
- npm: 5.6.0
Error Output
npm ERR! path /Users/lucaszimmermann/Desktop/myApp/node_modules/tsickle/src/main.js npm ERR! code ENOENT npm ERR! errno -2 npm ERR! syscall chmod npm ERR! enoent ENOENT: 没有该文件或目录,chmod '/Users/lucaszimmermann/Desktop/myApp/node_modules/tsickle/src/main.js' npm ERR! enoent 这与npm无法找到文件相关。
What's Going On Here?
This error pops up because npm is trying to set permissions (via chmod) on a file that doesn't actually exist in your node_modules folder. Common causes include:
- Corrupted npm cache leading to incomplete package downloads
- A broken
package-lock.jsonthat references files that never got installed - Partial or failed installation of the tsickle package
- Permission issues preventing the file from being created during the install process
Fixes You Can Try Right Now
- Clear the npm cache first: Corrupted cache is one of the most frequent causes here. Run
npm cache clean --forceto wipe any cached package data that might be causing the missing file reference. - Start fresh with dependencies: Delete your
node_modulesfolder andpackage-lock.jsonfile completely, then runnpm installagain. This gets rid of any half-installed packages or broken lock file entries that might be messing things up. - Reinstall tsickle manually: Sometimes the tsickle package doesn't install properly on the first pass. Run
npm install tsickle --save-devto force a fresh install of this specific package, then trynpm installagain for the rest of your dependencies. - Check directory permissions: Make sure your user account has full read/write access to your project folder. If you're hitting permission blocks, you can try
sudo npm install(just note that using sudo can cause permission issues later, so it's better to adjust folder permissions withchown -R $USER /Users/lucaszimmermann/Desktop/myAppif possible). - Update npm to a compatible version: Since you're on Node 8.10.0, the latest compatible npm 5.x version is 5.10.0. Updating might fix some installation bugs—run
npm install -g npm@5.10.0to update your global npm.
内容的提问来源于stack exchange,提问作者Luska Zimmermann
相关产品推荐
相关产品推荐

