【问题标题】:npm Error Failed at the node-sass@4.9.0 install scriptnpm 错误在 node-sass@4.9.0 安装脚本中失败
【发布时间】:2018-11-23 15:56:00
【问题描述】:

当我尝试在 Windows 终端上运行“ionic start MyApp”时收到此错误。

我在一台新机器上运行,我已经尝试重新安装 nodejs 和 ionic,但总是出现同样的错误。

谁能帮帮我?

npm WARN tar invalid entry

    > node-sass@4.9.0 install C:\Users\Felipe\Desktop\Kokua App\KokuaApp1\node_modules\node-sass
    > node scripts/install.js

    module.js:549
         throw err;
         ^

    Error: Cannot find module 'minimatch'
         at Function.Module._resolveFilename (module.js:547:15)
         at Function.Module._load (module.js:474:25)
         at Module.require (module.js:596:17)
         at require (internal/module.js:11:18)
         at Object.<anonymous> (C:\Users\Felipe\Desktop\Kokua
    App\KokuaApp1\node_modules\true-case-path\node_modules\glob\glob.js:44:17)
         at Module._compile (module.js:652:30)
         at Object.Module._extensions..js (module.js:663:10)
         at Module.load (module.js:565:32)
         at tryModuleLoad (module.js:505:12)
         at Function.Module._load (module.js:497:3)
    npm WARN rollback Rolling back node-pre-gyp@0.10.0 failed (this is probably harmless): EPERM: operation not
    permitted, scandir 'C:\Users\Felipe\Desktop\Kokua App\KokuaApp1\node_modules\fsevents\node_modules'
    npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules\fsevents):
    npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted
    {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! node-sass@4.9.0 install: `node scripts/install.js`
    npm ERR! Exit status 1
    npm ERR!
    npm ERR! Failed at the node-sass@4.9.0 install script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

    npm ERR! A complete log of this run can be found in:
    npm ERR!     C:\Users\Felipe\AppData\Roaming\npm-cache\_logs\2018-06-13T23_54_19_462Z-debug.log

【问题讨论】:

    标签: javascript node.js ionic-framework npm npm-install


    【解决方案1】:

    尝试安装最新版本的 ionic:

    $ npm cache verify
    $ npm i -g ionic cordova
    

    如果这不起作用,您需要手动安装库minimatch

    $ npm i --save minimatch
    

    【讨论】:

    • 仍然无法正常工作...当我尝试创建一个新的 ionic 项目时出现此问题...
    • 你能再检查一下我的答案吗?
    • 好吧,我可以看到你的答案,但是“npm i --save minimatch”不能解决我的问题
    • 当我尝试“离子服务”时,此项目创建时出现此错误:错误:找不到模块'C:\Users\Felipe\Desktop\Kokua App\KokuaApp1\node_modules\@ionic\app-脚本'
    • 对于那个错误运行这个命令 $ npm install -g @ionic/app-scripts@latest --save-dev
    【解决方案2】:

    通过这些步骤解决问题:

    $ npm uninstall cordova ionic
    $ npm cache clean -f
    $ npm install npm -g
    

    然后卸载nodejs,重新安装,重新安装ionic cordova

    $ npm install -g cordova ionic
    

    【讨论】:

      猜你喜欢
      • 2018-10-16
      • 2021-10-14
      • 2019-06-22
      • 2018-06-26
      • 2020-02-25
      • 1970-01-01
      • 1970-01-01
      • 2020-01-25
      • 2018-11-06
      相关资源
      最近更新 更多