【问题标题】:ENOENT error when doing ionic start进行离子启动时出现 ENOENT 错误
【发布时间】:2017-02-08 04:09:39
【问题描述】:

我升级到 beta.23 并在使用“ionic start foo --v2 --verbose”创建新项目时开始出现错误。
红色的错误说 “无法生成命令错误:生成 npm ENOENT (CLI v2.0.0-beta.23)。”

我已经安装了 npm 并且可以从 Windows 8 cmd 行运行。 我尝试升级到节点 v5.9.1。 我确认 npm 在 PATH 环境变量中,并且可以从 cmd shell 运行 npm。 任何如何进一步修复或调试的想法将不胜感激。

这是完整的输出:

   C:\ionic2>ionic start foo --v2 --verbose
   Task setting: title=start, name=start, summary=Starts a new Ionic project in the
    specified PATH, [options]=any flags for the command, <PATH>=directory for the n
    ew project, [template]=Starter templates can either come from a named     template,

   (ex: tabs, sidemenu, blank),
   a Github repo, a Codepen url, or a local directory.
   Codepen url,
Defaults to Ionic "tabs" starter template, --appname|-a=Human readable name     for
the app (Use quotes around the name), --id|-i=Package name for <widget id>     confi
g, ex: com.mycompany.myapp, title=Skip npm package installation,     boolean=true, t
itle=Create a basic structure without Cordova requirements, boolean=true,     title=
   Setup the project to use Sass CSS precompiling, boolean=true, title=List starter
 templates available, boolean=true, --io-app-id=The Ionic.io app ID to use, --te
mplate|-t=Project starter template, boolean=true, title=Start a Ionic v2 project
, boolean=true, title=(with --v2 only) Use TypeScript in starter, --zip-file|-z=
URL to download zipfile for starter template, module=./ionic/start, disableChang
ePwd=true
Utils.preprocessCliOptions _=[start, foo], skip-npm=false, no-cordova=false, w=f
alse, sass=false, s=false, list=false, l=false, v2=true, v=false, typescript=fal
se, -ts=false, verbose=true, $0=C:\Program Files\nodejs\node.exe C:\Users\bradtk
e\AppData\Roaming\npm\node_modules\ionic\bin\ionic

One awesome Ionic app coming right up...

Creating Ionic app in folder C:\ionic2\foo based on tabs project
     Downloading: https://github.com/driftyco/ionic2-app-base/archive/master.zip
     [=============================]  100%  0.0s
     Downloading: https://github.com/driftyco/ionic2-starter-          
       tabs/archive/master.zip
[=============================]  100%  0.0s
Installing npm packages...
Running exec command: npminstall
Utils.fail Unable to run spawn commandError: spawn npm ENOENT undefined
Utils.fail stack undefined
Utils.errorHandler is set, calling that now
Cli.Utils.errorHandler msg Unable to run spawn commandError: spawn npm ENOENT st
ring

Unable to run spawn commandError: spawn npm ENOENT (CLI v2.0.0-beta.23)

Your system information:

Cordova CLI: 6.1.0 (cordova-lib@undefined)
Ionic CLI Version: 2.0.0-beta.23
Ionic App Lib Version: 2.0.0-beta.13
OS: Windows 8.1
Node Version: v5.9.1

问候, 布鲁斯

【问题讨论】:

    标签: ionic2


    【解决方案1】:

    我也有同样的问题。在 beta 22 中工作。

    恢复到早期的测试版解决了这个问题:

    npm install -g ionic@2.0.0-beta.22
    

    【讨论】:

    • 谢谢。降级到 beta.22 成功了(ENOENT)错误。我能够创建新项目。 FWIW,当我使用'ionic start foo --v2'创建项目时,我收到一条关于cordova版本必须大于4.2的讨厌的红色消息。但是我的科尔多瓦是6.1。不确定这里发生了什么或影响。
    • 我们现在是 2.0.0-beta.29。有谁知道这个问题现在是否在 29 中得到了正确修复,还是我们仍然应该降级到 22?如果现在使用 22 制作初始项目,升级将如何影响事情......
    • 想知道这是否还没有达到 ionic!
    【解决方案2】:

    移动到应用程序的文件夹并运行npm install。我不知道发生了什么,但听起来像 start 脚本试图执行 npminstall 而不是 npm install

    Installing npm packages...
    Running exec command: npminstall
    

    【讨论】:

    • 我还必须在 Win10 上运行提升以及手动 npm 安装。
    【解决方案3】:

    这是 Windows 上 CLI 的一个已知问题。降级到 cli beta22 目前可以作为解决方法,但这将在下一个版本中修复

    【讨论】:

    • @mhartington,嗨 Mike,我在 Mac 上,但我的同事在 Windows 上遇到了这个问题,即使是在版本 26 中。我们现在是版本 29,这个问题已经解决了吗?或者他是否应该继续保持 22 的降级。如果他在 22 岁,而我在 29 岁,这将如何影响......
    【解决方案4】:

    升级 npm 对我有用。 npm install -g npm

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-02-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-04-19
      • 1970-01-01
      相关资源
      最近更新 更多