首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >npm ERR节点V,npm ERR npm在Windows上运行一个带有离子的android应用程序

npm ERR节点V,npm ERR npm在Windows上运行一个带有离子的android应用程序
EN

Stack Overflow用户
提问于 2017-05-16 07:27:40
回答 2查看 954关注 0票数 0

我有一个问题,运行一个程序通过离子。我安装了所需的一切,并试图模仿一个android测试应用程序,它的工作没有任何问题,但如果我试图启动我的同事的程序:

代码语言:javascript
复制
npm ERR! Windows_NT 10.0.15063
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "ionic:build" "--"
npm ERR! node v7.10.0
npm ERR! npm  v4.2.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1

这些错误发生了,我们搞不懂这意味着什么。他在Linux机器上开发了这个应用程序,如果他在他的机器上启动这个应用程序,它就能工作。我用的是Windows机器。这会不会是我们的问题的罪魁祸首?我们都有相同的节点/npm版本。我使用“离子运行android”命令,启动应用程序。

顺便说一句。完整的错误日志,如果有帮助的话:

代码语言:javascript
复制
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'run',
1 verbose cli   'ionic:build',
1 verbose cli   '--' ]
2 info using npm@4.2.0
3 info using node@v7.10.0
4 verbose run-script [ 'preionic:build', 'ionic:build', 'postionic:build' ]
5 info lifecycle hnwApp@~preionic:build: hnwApp@
6 silly lifecycle hnwApp@~preionic:build: no script for preionic:build, continuing
7 info lifecycle hnwApp@~ionic:build: hnwApp@
8 verbose lifecycle hnwApp@~ionic:build: unsafe-perm in lifecycle true
9 verbose lifecycle hnwApp@~ionic:build: PATH: C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin;C:\dev\papp\app\node_modules\.bin;C:\Users\entwickler\AppData\Roaming\npm;C:\Program Files\nodejs\;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Lenovo\Touch Fingerprint Software\;C:\Program Files (x86)\Common Files\Lenovo;C:\ProgramData\Lenovo\ReadyApps;C:\Program Files\OpenVPN\bin;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;%JAVA_HOME%\bin;C:\Program Files\apache-ant-1.10.1\bin;%ANDROID_HOME%\tools;%ANDROID_HOME%\platform-tools;C:\Program Files\Git\cmd;C:\Gradle\gradle-3.5\bin;C:\Program Files\nodejs\;C:\Users\entwickler\AppData\Local\Microsoft\WindowsApps;C:\Users\entwickler\AppData\Roaming\npm
10 verbose lifecycle hnwApp@~ionic:build: CWD: C:\dev\papp\app
11 silly lifecycle hnwApp@~ionic:build: Args: [ '/d /s /c', 'ionic-app-scripts build' ]
12 silly lifecycle hnwApp@~ionic:build: Returned: code: 1  signal: null
13 info lifecycle hnwApp@~ionic:build: Failed to exec ionic:build script
14 verbose stack Error: hnwApp@ ionic:build: `ionic-app-scripts build`
14 verbose stack Exit status 1
14 verbose stack     at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\utils\lifecycle.js:279:16)
14 verbose stack     at emitTwo (events.js:106:13)
14 verbose stack     at EventEmitter.emit (events.js:194:7)
14 verbose stack     at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\utils\spawn.js:40:14)
14 verbose stack     at emitTwo (events.js:106:13)
14 verbose stack     at ChildProcess.emit (events.js:194:7)
14 verbose stack     at maybeClose (internal/child_process.js:899:16)
14 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
15 verbose pkgid hnwApp@
16 verbose cwd C:\dev\papp\app
17 error Windows_NT 10.0.15063
18 error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "ionic:build" "--"
19 error node v7.10.0
20 error npm  v4.2.0
21 error code ELIFECYCLE
22 error errno 1
23 error hnwApp@ ionic:build: `ionic-app-scripts build`
23 error Exit status 1
24 error Failed at the hnwApp@ ionic:build script 'ionic-app-scripts build'.
24 error Make sure you have the latest version of node.js and npm installed.
24 error If you do, this is most likely a problem with the hnwApp package,
24 error not with npm itself.
24 error Tell the author that this fails on your system:
24 error     ionic-app-scripts build
24 error You can get information on how to open an issue for this project with:
24 error     npm bugs hnwApp
24 error Or if that isn't available, you can get their info via:
24 error     npm owner ls hnwApp
24 error There is likely additional logging output above.
25 verbose exit [ 1, true ]

以及cmd错误信息:

代码语言:javascript
复制
[08:21:12]  ionic-app-scripts 0.0.47
[08:21:12]  build dev started ...
[08:21:12]  clean started ...
[08:21:12]  clean finished in 16 ms
[08:21:12]  copy started ...
[08:21:12]  transpile started ...
[08:21:17]  typescript: C:/dev/papp/app/src/providers/my-data.ts, line: 7
[08:21:17]  typescript: C:/dev/papp/app/src/providers/my-data.ts, line: 8
            Cannot find name 'require'.

       L6:  //PouchDB.plugin(require('pouchdb-authentication'));
       L7:      var PouchDB = require("pouchdb");
       L8:      PouchDB.plugin(require('pouchdb-authentication'));

            Cannot find name 'require'.

       L7:      var PouchDB = require("pouchdb");
       L8:      PouchDB.plugin(require('pouchdb-authentication'));

[08:21:17]  transpile failed
[08:21:17]  ionic-app-script task: "build"
[08:21:17]  TypeError: error.message.indexOf is not a function

npm ERR! Windows_NT 10.0.15063
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "ionic:build" "--"
npm ERR! node v7.10.0
npm ERR! npm  v4.2.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! hnwApp@ ionic:build: `ionic-app-scripts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the hnwApp@ ionic:build script 'ionic-app-scripts build'.
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 hnwApp package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     ionic-app-scripts build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs hnwApp
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls hnwApp
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\entwickler\AppData\Roaming\npm-cache\_logs\2017-05-16T06_21_17_597Z-debug.log

非常感谢。

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2017-05-16 13:22:55

好吧,对不起,我很蠢。实施后

代码语言:javascript
复制
declare var require: any;

在我的数据中,这个应用程序终于起作用了。浪费这么多时间;-/

票数 0
EN

Stack Overflow用户

发布于 2017-05-16 08:48:12

问题在于在使用“离子型生成页”命令时创建的"page-name.component.ts“文件。 手动创建页面并运行它(离子运行android -prod)或(离子运行android -prod)。

试试这个。

https://github.com/driftyco/ionic-cli/issues/2119

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/43995013

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档