search

Home  >  Q&A  >  body text

node.js - npm install -g gulp 报错但不影响使用

**问题描述**:这个问题之前就有过,但是因为不影响使用,就一直忽略。最近和其他同事的npm比较过,分析较久未得出结论,在github上看了太多的issue,未找到答案,故前来求问请教,望大家帮忙看看,谢谢。

npm日志报错如图1,但不是所有的install都会报错。
比如安装express的时候就么米报错,参见图2。
使用起来又是正常的,参见图3。

我在想,是不是因为个人电脑(win7 64位)的问题。不想重装系统啊~~~
个人猜测:出错在open node modules的目录上,可能和个人电脑的文件夹权限有关,但是我没有设置过文件夹的权限啊,和别人的win7比较过,也没发现不一样的地方。

黄舟黄舟2782 days ago583

reply all(1)I'll reply

  • 迷茫

    迷茫2017-04-17 14:52:04

    The reason has been found. As guessed, after modifying the directory of the folder where nodejs is located to full control, it can be installed normally.
    Then when using the command in the project directory, an error will still be reported, and the error will prompt that the command cannot be found.
    At this time, a more crude method is used to change the directory of the entire disk to full control.

    Hope it helps everyone.

    reply
    0
  • Cancelreply