'ionic-app-scripts'不被识别为内部或外部命令, [英] 'ionic-app-scripts' is not recognized as an internal or external command,

查看:947
本文介绍了'ionic-app-scripts'不被识别为内部或外部命令,的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些电脑问题,当我尝试 ng服务 my ionic 2 app时,我收到了这个错误:

I had some computer issue, and when I tried to ng serve my ionic 2 app I received this error:


c:\ xampp \\\ htdocs \ thethemill> ionic serve

c:\xampp\htdocs\themill>ionic serve


ionic-hello- world @ ionic:发送c:\ xampp \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ --livereload-port35729

ionic-hello-world@ ionic:serve c:\xampp\htdocs\themill ionic-app-scripts serve "--v2" "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729"

'ionic-app-scripts'不被视为内部或外部
命令,可操作程序或批处理文件。

'ionic-app-scripts' is not recognized as an internal or external command, operable program or batch file.

npm ERR! Windows_NT 10.0.14393 npm ERR! argvC:\Program
Files \\\
odejs\\\
ode.exe
C:\ Users \home \ AppData \Roaming\\\
pm\\\
ode_modules \ nnpm \\ \\ bin \ nnpm-cli.js
runionic:serve - - v2 - address0.0.0.0 - port8100
--livereload-port35729npm ERR!节点v6.9.2 npm ERR! npm v4.0.2
npm ERR!代码ELIFECYCLE npm ERR! ionic-hello-world @ ionic:serve:
ionic-app-scripts提供--v2 - address0.0.0.0 - port8100
--livereload-port35729
npm ERR!退出状态1 npm ERR!错误的ERR!
在ionic-hello-world @ ionic失败:服务脚本'ionic-app-scripts
serve--v2 - address0.0.0.0 - port8100 - livereload-port
35729'。错误的ERR!确保安装了最新版本的node.js
和npm。错误的ERR!如果你这样做,这很可能是一个问题
使用ionic-hello-world包,npm ERR!不是与npm本身。 npm
ERR!告诉作者你的系统失败了:npm ERR!

ionic-app-scripts服务--v2 - address0.0.0.0 - port8100
--livereload-port35729

npm ERR! Windows_NT 10.0.14393 npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Users\home\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "run" "ionic:serve" "--" "--v2" "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729" npm ERR! node v6.9.2 npm ERR! npm v4.0.2 npm ERR! code ELIFECYCLE npm ERR! ionic-hello-world@ ionic:serve: ionic-app-scripts serve "--v2" "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729" npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the ionic-hello-world@ ionic:serve script 'ionic-app-scripts serve "--v2" "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729"'. npm ERR! Make sure you have the latest version of node.js and npm installed. npm ERR! If you do, this is most likely a problem with the ionic-hello-world package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR!
ionic-app-scripts serve "--v2" "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729"

我试图全球卸载,安装,安装,但它没有'解决。
任何想法有什么问题?

I tried to unistall, install, install globally, but it didn't solve. Any ideas what's wrong?

Windows 10。

Windows 10.

推荐答案

在我的情况下,问题是我正在使用mac并尝试将项目转移到Windows 10计算机。要遵循的步骤:

In my case the problem was that I was working on a mac and attempted to transfer the project to a windows 10 machine. Steps to follow:


  1. 在终端中,导航到离子项目的根文件夹

  2. 运行此命令: npm install @ ionic / app-scripts @ latest --save-dev

  3. 运行 npm rebuild node-sass 为您当前的环境构建绑定。

  1. In your terminal, navigate to the ionic project's root folder
  2. Run this command: npm install @ionic/app-scripts@latest --save-dev
  3. Run npm rebuild node-sass to build the binding for your current environment.

我不知道你的情况如何但在我的情况下,上述步骤有效。

I don't know what your case is but in my case, the above steps worked.

如果您的情况不同,可能是这里的文件:

If your case is different, perhaps the documentaion here:

https://www.npmjs.com/package/@ionic/app-scripts

将帮助您入门。

这篇关于'ionic-app-scripts'不被识别为内部或外部命令,的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆