我第一次在我的设备上运行应用程序。它没有在浏览器中工作(没有背景图片,登录API无法正常工作)......无论如何,在我的设备冻结后,我强行关闭它,然后就好像计算机上的某些东西混淆了一样一些东西。当我尝试现在运行app时,我得到:
module.js:327
throw err;
^
Error: Cannot find module 'lodash-node'
at Function.Module._resolveFilename (module.js:325:15)
at Function.Module._load (module.js:276:25)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (C:\Users\Marko\AppData\Roaming\npm\node_modules\ionic\node_modules\xmlbuilder\lib\index.js:5:7)
at Object.<anonymous> (C:\Users\Marko\AppData\Roaming\npm\node_modules\ionic\node_modules\xmlbuilder\lib\index.js:14:4)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
我尝试重新安装节点,我尝试使用lodash安装和缓存清理...有谁知道如何解决这个问题= /
运行时(之后仍然是同样的错误):
$ npm i --save lodash-node
npm WARN onload-script failed to require onload script npm-autoinit/autoinit
npm WARN onload-script Error: Cannot find module 'npm-autoinit/autoinit'
npm WARN onload-script at Function.Module._resolveFilename (module.js:325:15)
npm WARN onload-script at Function.Module._load (module.js:276:25)
npm WARN onload-script at Module.require (module.js:353:17)
npm WARN onload-script at require (internal/module.js:12:17)
npm WARN onload-script at cb (C:\Program Files\nodejs\node_modules\npm\lib\npm.js:289:9)
npm WARN onload-script at C:\Program Files\nodejs\node_modules\npm\lib\npm.js:382:14
npm WARN onload-script at C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:82:7
npm WARN onload-script at Array.forEach (native)
npm WARN onload-script at C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:81:13
npm WARN onload-script at f (C:\Program Files\nodejs\node_modules\npm\node_modules\once\once.js:17:25)
npm WARN onload-script { [Error: Cannot find module 'npm-autoinit/autoinit'] code: 'MODULE_NOT_FOUND' }
npm WARN onload-script failed to require onload script npm-autoinit/autoinit
npm WARN onload-script Error: Cannot find module 'npm-autoinit/autoinit'
npm WARN onload-script at Function.Module._resolveFilename (module.js:325:15)
npm WARN onload-script at Function.Module._load (module.js:276:25)
npm WARN onload-script at Module.require (module.js:353:17)
npm WARN onload-script at require (internal/module.js:12:17)
npm WARN onload-script at cb (C:\Program Files\nodejs\node_modules\npm\lib\npm.js:289:9)
npm WARN onload-script at C:\Program Files\nodejs\node_modules\npm\lib\npm.js:382:14
npm WARN onload-script at C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:82:7
npm WARN onload-script at Array.forEach (native)
npm WARN onload-script at C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:81:13
npm WARN onload-script at f (C:\Program Files\nodejs\node_modules\npm\node_modules\once\once.js:17:25)
npm WARN onload-script { [Error: Cannot find module 'npm-autoinit/autoinit'] code: 'MODULE_NOT_FOUND' }
npm WARN package.json roko@1.1.1 No repository field.
npm WARN package.json roko@1.1.1 No README data
npm WARN package.json roko@1.1.1 No license field.
npm WARN deprecated lodash-node@3.10.2: This package has been discontinued in favor of lodash@^4.0.0.
lodash-node@3.10.2 node_modules\lodash-node
答案 0 :(得分:0)
尝试安装任何 Node.js模块时,我在Windows上遇到了同样的错误。
运行npm config delete onload-script npm-autoinit/autoinit
。
我还有一堆警告
$ npm config delete onload-script npm-autoinit/autoinit
npm WARN onload-script failed to require onload script npm-autoinit/autoinit
npm WARN onload-script Error: Cannot find module 'npm-autoinit/autoinit'
[ . . . ]
npm WARN onload-script { [Error: Cannot find module 'npm-autoinit/autoinit'] code: 'MODULE_NOT_FOUND' }
但之后我能够毫无问题地安装模块。