node.js 错误运行 npm i 时发生错误(退出代码 1):离子错误
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/47069092/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
ERROR An error occurred while running npm i (exit code 1): Ionic Error
提问by Onkar
I started working on ionic, i am totally new to this, and following This tutorials, i know this type of question already asked but not have proper solution to it, please provide solution to it, step i followed as,
我开始研究离子,我对此完全陌生,并且按照本教程,我知道已经问过这种类型的问题,但没有适当的解决方案,请提供解决方案,我遵循的步骤是,
1.Node installed - node-v8.9.0-x86
2. ran command npm install -g cordova ionic
1.Node 安装 - node-v8.9.0-x86
2. 运行命令npm install -g cordova ionic
npm WARN deprecated [email protected]: Use uuid module instead
C:\Users\Android1\AppData\Roaming\npm\cordova ->
C:\Users\Android1\AppData\Roaming\npm\node_modules\cordova\bin\cordova
C:\Users\Android1\AppData\Roaming\npm\ionic ->
C:\Users\Android1\AppData\Roaming\npm\node_modules\ionic\bin\ionic
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected]
(node_modules\ionic\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for
[email protected]: wanted {"os":"darwin","arch":"any"} (current:
{"os":"win32","arch":"ia32"})
+ [email protected]
+ [email protected]
added 115 packages and updated 2 packages in 69.815s
- Then ran command
ionic start myApp tabs, got following Error
- 然后运行命令
ionic start myApp tabs,得到以下错误
Thank you,
谢谢,
回答by Onkar
After spending more than day i came across many solutions, which are as follow
花了一天多的时间后,我遇到了许多解决方案,如下所示
Some developers solve this problem by, i downgraded node from v8 to v7.6.0 and all seems to work fine with ionic CLI.From Herebut this solution not work for me.
Run Command Line as Administrative, this solution is beneficial
The Correct and well solution work for me, is to install install all node-gyp dependenciesby following command
$ npm install --global --production windows-build-toolsand then install the package
$ npm install --global node-gyp
一些开发人员通过以下方式解决了这个问题, 我将 node 从 v8 降级到 v7.6.0,并且在 ionic CLI 上似乎一切正常。从这里但是这个解决方案对我不起作用。
以管理身份运行命令行,此解决方案很有用
对我来说正确且有效的解决方案是 通过以下命令安装所有 node-gyp 依赖项
$ npm install --global --production windows-build-tools然后安装包
$ npm install --global node-gyp
Solution Link
解决方案链接
回答by Shubham Kandiyal
I also face the same problem.
我也面临同样的问题。
Solution is worked for me in Ubuntu 16.04:
解决方案在 Ubuntu 16.04 中对我有用:
sudo -s
须藤 -s
First Get Access of Super User from Above Command
首先从上面的命令获取超级用户的访问权限
sudo ionic start myApp tabs
sudo ionic 启动 myApp 选项卡
After Get into SUDO Mode, then run ionic command with sudo, like above
进入 SUDO 模式后,然后使用 sudo 运行 ionic 命令,如上
Thanks
谢谢
回答by Debasis Das
Solution:
解决方案:
step 1 : sudo -s
第 1 步:sudo -s
step 2 : sudo ionic start todo blank ( for ubuntu )
第 2 步:sudo ionic start todo blank(对于 ubuntu)
回答by Atit More
I was facing same problem. So, I installed my node module using yarninstead of npm. And it worked for me. Try it using [Yarn][1]
我面临同样的问题。因此,我使用yarn代替npm. 它对我有用。尝试使用[Yarn][1]
You can try it and check.
你可以试试看。
Thank You.
谢谢你。
回答by Prakash P
Please follow the simple procedure to solve this issue:
请按照简单的程序来解决这个问题:
- Delete
- 删除
(1)npm and
(1)npm 和
(2)npm-cache
(2)npm-缓存
folders manually. [You can find it in => %AppData%/npm-cache on Windows.]
手动文件夹。[您可以在 Windows 上的 => %AppData%/npm-cache 中找到它。]
Uninstall the Node.Js application in Programs and Features in Windows-OS.
Restart the System.
Once again re-install Node.Js in your system, perfectly.
open terminal anywhere (preferably from Desktop) and run
在 Windows-OS 的程序和功能中卸载 Node.Js 应用程序。
重新启动系统。
再次在您的系统中重新安装 Node.Js,完美。
在任何地方打开终端(最好从桌面)并运行
node --version
节点 --version
and check it is latest version.
并检查它是最新版本。
- Run
- 跑
npm --version
npm --version
and check it is latest version.
并检查它是最新版本。
- Run
- 跑
git--version
git--版本
and check it is latest version.
并检查它是最新版本。
- Run
- 跑
npm install -g ionic
npm install -g 离子
- Finally Run,
- 最后运行,
ionic start myApp tabs
离子启动 myApp 选项卡
Here ==>>wait for more time (8-10 mins)<<== until all the ionic files to be downloaded, install and create a new ionic app in the given name.
这里==>>等待更多时间(8-10 分钟)<<== 直到所有 ionic 文件都被下载,安装并以给定名称创建一个新的 ionic 应用程序。
Finally, a new ionic project will be created.
Go to the project folder of that particular ionic project and Run
最后,将创建一个新的 ionic 项目。
转到该特定离子项目的项目文件夹并运行
ionic serve
离子服务
The project will run in Browser.
该项目将在浏览器中运行。
All the best, Devs ..!!!
一切顺利,开发人员..!!!
回答by ngShravil.py
Try running 'npm i' command in the project directory in sudo mode or administrator mode. This worked for me.
尝试以 sudo 模式或管理员模式在项目目录中运行“npm i”命令。这对我有用。


