New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPM 使用问题汇总 #565

Open
xiangshouding opened this Issue Jun 25, 2015 · 116 comments

Comments

Projects
None yet
@xiangshouding
Contributor

xiangshouding commented Jun 25, 2015

现在 NPM 可谓是 node 的最佳包管理平台,很自然的 FIS 也放在上面。但是大家对 NPM 不甚了解,碰到一些稀奇古怪的安装问题觉着很摸不着头脑,然后把怒气直指 FIS。为了大家不动肝火,以及方便大家查阅,打算对常 NPM 常见问题在此汇总一下。

如何查看所有 NPM 的设置

npm config ls -l

全局安装了无法找到命令

大家都知道,FIS 是要求全局安装的,是因为避免由于 FIS 多版本不同项目目录下而导致编译时有差异,而导致不必要的麻烦。

有些同学可能遇到了

npm install -g fis

命令行执行 fis找不到这个命令。这时候一般都开始抓瞎了。

解决办法:

  • 执行 npm prefix -g 会输出全局安装路径
  • Windows 用户把输出的路径添加到环境变量 %PATH% 里面,环境变量的设置请参考 百度
  • 类 Unix 用户把 $(npm prefix -g)/bin 目录设置到 PATH 中。
    • 用 bash echo -e "export PATH=$(npm prefix -g)/bin:$PATH" >> ~/.bashrc && source ~/.bashrc
    • 用 zsh echo -e "export PATH=$(npm prefix -g)/bin:$PATH" >> ~/.zshrc && source ~/.zshrc

全局安装了无法 require 这个包

解决办法:

设置环境变量

  • Windows

    NODE_PATH=<prefix>/node_modules
    
    • <prefix> 执行 npm prefix -g 获得
  • 类 Unix

    export NODE_PATH=$(npm prefix -g)/lib/node_modules

安装过程中报错,checksum 失败

出现类似这样的错误

gyp ERR! stack Error: node-v0.12.7.tar.gz local checksum 
a797be06553ea8e13a6ec9c3cdd8ed1b065dd1d05d2a3a0378296e70cf16d5ab not match remote
b23d64df051c9c969b0c583f802d5d71de342e53067127a5061415be7e12f39d

解决办法

清除缓存再进行安装

npm cache clean

安装过程中说没权限,sudo 也不行

一般发生在_类Unix_系统中

  • 获取缓存目录 npm config get cache (~/.npm)

  • 删除缓存目录

    sudo rm -rf ~/.npm
  • 再次安装坚决不要用 sudo,如果还是出现权限问题请修改安装路径权限

安装长时间不成功

NPM 平台无奈被祖国电子长城防火墙阻隔了,时不时抽风。如果遇到这种情况只有三种解决办法;

  • 一次次重试

  • 换个国内的源

    npm install -g fis --disturl=http://registry.npm.taobao.org/mirrors/node --registry=http://registry.npm.taobao.org
    
  • 添加代理

    npm config set proxy <http proxy>
    npm config set https-proxy <https proxy> 
    
    • <http proxy> 换成你自己的 http 代理地址
    • <https proxy> 换成你自己的 https 代理地址

    注意: 如果换代理了,请更改配置,不然你又会怀疑上帝

安装报 gyp* 编译不成功

得详细说一下为啥有这种错误,其实 node 里面不是跑得是 V8 么,那么其第三方扩展机制也全盘拿了过来。这块说的第三方扩展是指 addon 插件,也就是所谓的 native 插件。请不要被这个词语吓着了,说白了就是写一个二进制插件,用 c++ 写的。

所以这类插件需要编译器(gcc,clang,vs)编译,安装这类插件的时候如果你系统没有装 VS 或者是 gcc 什么的编译器就会报错。

而且这类插件在各个版本的 node 下兼容性不好,所以报编译语法错误也是很正常的。遇到此类错误只有两种解决办法;

  • 自己搞懂机制自己编译插件
  • 到作者 GitHub 上求助

想本地安装而非全局安装,运行 FIS 怎么搞

由于种种维护上的原因,FIS 必须要全局安装包括其插件,有些人就受不了这个,觉着是反模式,咋眼一看确实是,但长远来看安装全局同一版本才是王道,有过 node 工程实践的同学对此估计深有体会。

但不巧,上线编译的时候用的编译机不是自己的机器,而无法部署 FIS 编译环境啊。这时候怎么办呢?

首先,我们得了解一下 NPM 安装的时候的一些处理。不才,直接贴 NPM 的文档。

DIRECTORIES
       See npm help 5 npm-folders to learn about where npm puts stuff.

       In particular, npm has two modes of operation:

       - global mode:
         npm installs packages into the install prefix at prefix/lib/node_modules and bins are installed in prefix/bin.

       - local mode:
         npm installs packages into the current project directory, which defaults to  the  current  working  directory.   Packages  are
         installed to ./node_modules, and bins are installed to ./node_modules/.bin.


       Local mode is the default.  Use --global or -g on any command to operate in global mode instead.

看到 local mode 的解释了吧。当 local mode 安装的时候,会把 bin 链接到 ./node_modules/.bin 目录下。

那么当本地安装 FIS

npm install fis

执行

./node_modules/.bin/fis -v

来调用 FIS 进行操作。

假设你想进行更方便的操作,设置两个环境变量即可。

  • PATH 执行命令靠它
  • NODE_PATH node require 靠它

然后就没有然后了,你可以肆意蹂躏了。

@xiangshouding xiangshouding added the faq label Jun 25, 2015

@xiangshouding xiangshouding changed the title from NPM 使用注意事项 to NPM 使用问题汇总 Jun 25, 2015

@boboxiao

This comment has been minimized.

Show comment
Hide comment
@boboxiao

boboxiao Aug 4, 2015

始终还是安装不成功!

boboxiao commented Aug 4, 2015

始终还是安装不成功!

@boboxiao

This comment has been minimized.

Show comment
Hide comment
@boboxiao

boboxiao Aug 4, 2015

报错:
npm ERR! Error: shasum check failed for /tmp/npm-32475-sRV7oL_x/registry.npmjs.org/node-pngcrush/-/node-pngcrush-0.2.0.tgz
npm ERR! Expected: bd87b2ad24938604ae888add94ae58fa111354c8
npm ERR! Actual: 8d663ed6b7329fbd55ac60dd1b8beae4d5d1dffd
npm ERR! From: https://registry.npmjs.org/node-pngcrush/-/node-pngcrush-0.2.0.tgz
npm ERR! at /usr/local/lib/node_modules/npm/node_modules/sha/index.js:38:8
npm ERR! at ReadStream. (/usr/local/lib/node_modules/npm/node_modules/sha/index.js:85:7)
npm ERR! at ReadStream.emit (events.js:117:20)
npm ERR! at _stream_readable.js:938:16
npm ERR! at process._tickCallback (node.js:419:13)
npm ERR! If you need help, you may report this entire log,
npm ERR! including the npm and node versions, at:
npm ERR! http://github.com/npm/npm/issues

npm ERR! System Darwin 14.4.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "fis3"
npm ERR! cwd /Users/bobo
npm ERR! node -v v0.10.30
npm ERR! npm -v 1.4.21
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/bobo/npm-debug.log
npm ERR! not ok code 0

boboxiao commented Aug 4, 2015

报错:
npm ERR! Error: shasum check failed for /tmp/npm-32475-sRV7oL_x/registry.npmjs.org/node-pngcrush/-/node-pngcrush-0.2.0.tgz
npm ERR! Expected: bd87b2ad24938604ae888add94ae58fa111354c8
npm ERR! Actual: 8d663ed6b7329fbd55ac60dd1b8beae4d5d1dffd
npm ERR! From: https://registry.npmjs.org/node-pngcrush/-/node-pngcrush-0.2.0.tgz
npm ERR! at /usr/local/lib/node_modules/npm/node_modules/sha/index.js:38:8
npm ERR! at ReadStream. (/usr/local/lib/node_modules/npm/node_modules/sha/index.js:85:7)
npm ERR! at ReadStream.emit (events.js:117:20)
npm ERR! at _stream_readable.js:938:16
npm ERR! at process._tickCallback (node.js:419:13)
npm ERR! If you need help, you may report this entire log,
npm ERR! including the npm and node versions, at:
npm ERR! http://github.com/npm/npm/issues

npm ERR! System Darwin 14.4.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "fis3"
npm ERR! cwd /Users/bobo
npm ERR! node -v v0.10.30
npm ERR! npm -v 1.4.21
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/bobo/npm-debug.log
npm ERR! not ok code 0

@lengziyu

This comment has been minimized.

Show comment
Hide comment
@lengziyu

lengziyu Aug 7, 2015

我和楼上一样,安装不成功!

lengziyu commented Aug 7, 2015

我和楼上一样,安装不成功!

@xiangshouding

This comment has been minimized.

Show comment
Hide comment
@xiangshouding

xiangshouding Aug 7, 2015

Contributor
npm cache clean

后重试

Contributor

xiangshouding commented Aug 7, 2015

npm cache clean

后重试

@lengziyu

This comment has been minimized.

Show comment
Hide comment
@lengziyu

lengziyu Aug 7, 2015

还是报错- -
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "F:\node\node.exe" "F:\node\node_modules\npm\bin\npm-cli.
js" "install" "-g" "fis3"
npm ERR! node v0.12.4
npm ERR! npm v2.10.1
npm ERR! code ENOTFOUND
npm ERR! errno ENOTFOUND
npm ERR! syscall getaddrinfo

npm ERR! network getaddrinfo ENOTFOUND registry.npmjs.org
npm ERR! network This is most likely not a problem with npm itself
npm ERR! network and is related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settin
gs.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. See: 'npm help config'

npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\Administrator\npm-debug.log

lengziyu commented Aug 7, 2015

还是报错- -
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "F:\node\node.exe" "F:\node\node_modules\npm\bin\npm-cli.
js" "install" "-g" "fis3"
npm ERR! node v0.12.4
npm ERR! npm v2.10.1
npm ERR! code ENOTFOUND
npm ERR! errno ENOTFOUND
npm ERR! syscall getaddrinfo

npm ERR! network getaddrinfo ENOTFOUND registry.npmjs.org
npm ERR! network This is most likely not a problem with npm itself
npm ERR! network and is related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settin
gs.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. See: 'npm help config'

npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\Administrator\npm-debug.log

@xiangshouding

This comment has been minimized.

Show comment
Hide comment
@xiangshouding

xiangshouding Aug 7, 2015

Contributor

@lengziyu 你网络不通?为什么连 npm 都访问不了?

Contributor

xiangshouding commented Aug 7, 2015

@lengziyu 你网络不通?为什么连 npm 都访问不了?

@lengziyu

This comment has been minimized.

Show comment
Hide comment
@lengziyu

lengziyu Aug 7, 2015

@xiangshouding 额,可能是我网络问题,最近总是断线。我回家试试看,谢谢~

lengziyu commented Aug 7, 2015

@xiangshouding 额,可能是我网络问题,最近总是断线。我回家试试看,谢谢~

@lengziyu

This comment has been minimized.

Show comment
Hide comment
@lengziyu

lengziyu Aug 7, 2015

@xiangshouding 网络恢复了,安装成功了,再次感谢~慢慢开始撸FIS了

lengziyu commented Aug 7, 2015

@xiangshouding 网络恢复了,安装成功了,再次感谢~慢慢开始撸FIS了

@lj7711622

This comment has been minimized.

Show comment
Hide comment
@lj7711622

lj7711622 Aug 7, 2015

fis-command-server@0.7.6 这个依赖找不到啊 什么情况啊

lj7711622 commented Aug 7, 2015

fis-command-server@0.7.6 这个依赖找不到啊 什么情况啊

@lj7711622

This comment has been minimized.

Show comment
Hide comment
@lj7711622

lj7711622 Aug 7, 2015

npm WARN install Couldn't install optional dependency: No compatible version fou
nd: fis-command-server@0.7.6
npm WARN install Valid install targets:
npm WARN install ["0.7.5","0.7.4","0.7.3","0.7.2","0.7.1","0.7.0","0.7.0-beta6",
"0.7.0-beta5","0.7.0-beta4","0.7.0-beta3","0.7.0-beta2","0.7.0-beta","0.6.12","0
.6.11","0.6.10","0.6.9","0.6.8","0.6.7","0.6.6","0.6.5","0.6.4","0.6.3","0.6.2",
"0.6.1","0.6.0","0.5.9","0.5.8","0.5.7","0.5.6","0.5.5","0.5.4","0.5.3","0.5.2",
"0.5.1","0.5.0","0.4.9","0.4.8","0.4.7","0.4.6","0.4.5","0.4.4","0.4.3","0.4.2",
"0.4.1","0.4.0","0.3.4","0.3.3","0.3.2","0.3.1","0.3.0","0.2.8","0.2.7","0.2.6",
"0.2.5","0.2.4","0.2.3","0.2.2","0.2.1","0.2.0","0.1.9","0.1.8","0.1.7","0.1.6",
"0.1.5","0.1.3","0.1.2","0.1.1","0.1.0","0.0.8","0.0.7","0.0.6","0.0.4","0.0.3",
"0.0.2","0.0.1"]

lj7711622 commented Aug 7, 2015

npm WARN install Couldn't install optional dependency: No compatible version fou
nd: fis-command-server@0.7.6
npm WARN install Valid install targets:
npm WARN install ["0.7.5","0.7.4","0.7.3","0.7.2","0.7.1","0.7.0","0.7.0-beta6",
"0.7.0-beta5","0.7.0-beta4","0.7.0-beta3","0.7.0-beta2","0.7.0-beta","0.6.12","0
.6.11","0.6.10","0.6.9","0.6.8","0.6.7","0.6.6","0.6.5","0.6.4","0.6.3","0.6.2",
"0.6.1","0.6.0","0.5.9","0.5.8","0.5.7","0.5.6","0.5.5","0.5.4","0.5.3","0.5.2",
"0.5.1","0.5.0","0.4.9","0.4.8","0.4.7","0.4.6","0.4.5","0.4.4","0.4.3","0.4.2",
"0.4.1","0.4.0","0.3.4","0.3.3","0.3.2","0.3.1","0.3.0","0.2.8","0.2.7","0.2.6",
"0.2.5","0.2.4","0.2.3","0.2.2","0.2.1","0.2.0","0.1.9","0.1.8","0.1.7","0.1.6",
"0.1.5","0.1.3","0.1.2","0.1.1","0.1.0","0.0.8","0.0.7","0.0.6","0.0.4","0.0.3",
"0.0.2","0.0.1"]

@zhangtao07

This comment has been minimized.

Show comment
Hide comment
@zhangtao07

zhangtao07 Aug 7, 2015

Member

0.7.6 今天几小时前刚发布,可能是你的npm源还没更新,请稍后重试或者使用官方源试试

Member

zhangtao07 commented Aug 7, 2015

0.7.6 今天几小时前刚发布,可能是你的npm源还没更新,请稍后重试或者使用官方源试试

@lj7711622

This comment has been minimized.

Show comment
Hide comment
@lj7711622

lj7711622 Aug 7, 2015

fis3 如果css 不是相对路径的 有没有办法 修改 rel="stylesheet" type="text/css" href="<%=path%>/css/base.css"> 中的base.css 为 base_c9fff2a.css

lj7711622 commented Aug 7, 2015

fis3 如果css 不是相对路径的 有没有办法 修改 rel="stylesheet" type="text/css" href="<%=path%>/css/base.css"> 中的base.css 为 base_c9fff2a.css

@oliverxyy

This comment has been minimized.

Show comment
Hide comment
@oliverxyy

oliverxyy Aug 11, 2015

我安装好了,但是过程中出现了这个warning:npm WARN optional dep failed, continuing fsevents@0.3.8,这是神马问题撒?

oliverxyy commented Aug 11, 2015

我安装好了,但是过程中出现了这个warning:npm WARN optional dep failed, continuing fsevents@0.3.8,这是神马问题撒?

@lj7711622

This comment has been minimized.

Show comment
Hide comment
@lj7711622

lj7711622 Aug 11, 2015

@oliverxyy npm cache clean 试试

lj7711622 commented Aug 11, 2015

@oliverxyy npm cache clean 试试

@MurphyZL

This comment has been minimized.

Show comment
Hide comment
@MurphyZL

MurphyZL Aug 13, 2015

安装不成功:
fix@1.9.29 uninstall C:\User\zhangling\AppData\Roaming\npm\node_modules\fis
node -e "var cp = require('child_process'); cp.exec('bin/fis server stop');"

MurphyZL commented Aug 13, 2015

安装不成功:
fix@1.9.29 uninstall C:\User\zhangling\AppData\Roaming\npm\node_modules\fis
node -e "var cp = require('child_process'); cp.exec('bin/fis server stop');"

@MurphyZL

This comment has been minimized.

Show comment
Hide comment
@MurphyZL

MurphyZL Aug 13, 2015

安装fis3运行安装程序之后:

images@2.1.5 install C:\Users\zhangling\AppData\Roaming\npm\node_modules\fis3\node_modules\fis-spriter-csssprites\node_modules\images
echo "Hello, Word."

MurphyZL commented Aug 13, 2015

安装fis3运行安装程序之后:

images@2.1.5 install C:\Users\zhangling\AppData\Roaming\npm\node_modules\fis3\node_modules\fis-spriter-csssprites\node_modules\images
echo "Hello, Word."

@liuhanyu200

This comment has been minimized.

Show comment
Hide comment
@liuhanyu200

liuhanyu200 Aug 25, 2015

同上 输出 hello world 同上 源有问题 同上 输出warning:npm WARN optional dep failed, continuing fsevents@0.3.8

liuhanyu200 commented Aug 25, 2015

同上 输出 hello world 同上 源有问题 同上 输出warning:npm WARN optional dep failed, continuing fsevents@0.3.8

@liuhanyu200

This comment has been minimized.

Show comment
Hide comment
@liuhanyu200

liuhanyu200 Aug 25, 2015

现在 还在加载 估计要失败

liuhanyu200 commented Aug 25, 2015

现在 还在加载 估计要失败

@ordheart

This comment has been minimized.

Show comment
Hide comment
@ordheart

ordheart Sep 1, 2015

fis3 有米有国内资源地址,装不上哎,跪求

ordheart commented Sep 1, 2015

fis3 有米有国内资源地址,装不上哎,跪求

@2413052180

This comment has been minimized.

Show comment
Hide comment
@2413052180

2413052180 Sep 2, 2015

装上了,但运行fis3 -v的时候说找不到,环境变量加弄了,怎么回事啊

2413052180 commented Sep 2, 2015

装上了,但运行fis3 -v的时候说找不到,环境变量加弄了,怎么回事啊

@shenfusheng

This comment has been minimized.

Show comment
Hide comment
@shenfusheng

shenfusheng Sep 9, 2015

安装完fis3,运行fis3 -v 时就会报错如下:
sh.exe": /c/Users/fusheng/AppData/Roaming/npm/fis3: No such file or directory

shenfusheng commented Sep 9, 2015

安装完fis3,运行fis3 -v 时就会报错如下:
sh.exe": /c/Users/fusheng/AppData/Roaming/npm/fis3: No such file or directory

@xiangshouding

This comment has been minimized.

Show comment
Hide comment
@xiangshouding

xiangshouding Sep 9, 2015

Contributor

@shenfusheng 请在 CMD 中执行,而不是 git-bash 亦或是 cygwin console

Contributor

xiangshouding commented Sep 9, 2015

@shenfusheng 请在 CMD 中执行,而不是 git-bash 亦或是 cygwin console

@shenfusheng

This comment has been minimized.

Show comment
Hide comment
@shenfusheng

shenfusheng Sep 9, 2015

@xiangshouding 重新再git-bash执行几次就ok了,有个疑问就是为什么一定要在CMD中执行呢?

shenfusheng commented Sep 9, 2015

@xiangshouding 重新再git-bash执行几次就ok了,有个疑问就是为什么一定要在CMD中执行呢?

@xiangshouding

This comment has been minimized.

Show comment
Hide comment
@xiangshouding

xiangshouding Sep 9, 2015

Contributor

@shenfusheng 因为,windows 上默认有 CMD

Contributor

xiangshouding commented Sep 9, 2015

@shenfusheng 因为,windows 上默认有 CMD

@shenfusheng

This comment has been minimized.

Show comment
Hide comment
@shenfusheng

shenfusheng Sep 9, 2015

@xiangshouding 好吧,谢谢,辛苦啦!

shenfusheng commented Sep 9, 2015

@xiangshouding 好吧,谢谢,辛苦啦!

@yunhailu

This comment has been minimized.

Show comment
Hide comment
@yunhailu

yunhailu Sep 10, 2015

npm ERR! tar.unpack untar error /Users/MLS/.npm/fis/1.9.33/package.tgz
npm ERR! Darwin 14.3.0
npm ERR! argv "node" "/usr/local/bin/npm" "install" "-g" "fis"
npm ERR! node v0.12.7
npm ERR! npm v2.11.3
npm ERR! path /usr/local/lib/node_modules/fis
npm ERR! code EACCES
npm ERR! errno -13

npm ERR! Error: EACCES, mkdir '/usr/local/lib/node_modules/fis'
npm ERR! at Error (native)
npm ERR! { [Error: EACCES, mkdir '/usr/local/lib/node_modules/fis']
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! path: '/usr/local/lib/node_modules/fis',
npm ERR! fstream_type: 'Directory',
npm ERR! fstream_path: '/usr/local/lib/node_modules/fis',
npm ERR! fstream_class: 'DirWriter',
npm ERR! fstream_stack:
npm ERR! [ '/usr/local/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:35:25',
npm ERR! '/usr/local/lib/node_modules/npm/node_modules/mkdirp/index.js:47:53',
npm ERR! 'FSReqWrap.oncomplete (fs.js:95:15)' ] }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

npm ERR! Please include the following file with any support request:
npm ERR! /Users/MLS/npm-debug.log

yunhailu commented Sep 10, 2015

npm ERR! tar.unpack untar error /Users/MLS/.npm/fis/1.9.33/package.tgz
npm ERR! Darwin 14.3.0
npm ERR! argv "node" "/usr/local/bin/npm" "install" "-g" "fis"
npm ERR! node v0.12.7
npm ERR! npm v2.11.3
npm ERR! path /usr/local/lib/node_modules/fis
npm ERR! code EACCES
npm ERR! errno -13

npm ERR! Error: EACCES, mkdir '/usr/local/lib/node_modules/fis'
npm ERR! at Error (native)
npm ERR! { [Error: EACCES, mkdir '/usr/local/lib/node_modules/fis']
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! path: '/usr/local/lib/node_modules/fis',
npm ERR! fstream_type: 'Directory',
npm ERR! fstream_path: '/usr/local/lib/node_modules/fis',
npm ERR! fstream_class: 'DirWriter',
npm ERR! fstream_stack:
npm ERR! [ '/usr/local/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:35:25',
npm ERR! '/usr/local/lib/node_modules/npm/node_modules/mkdirp/index.js:47:53',
npm ERR! 'FSReqWrap.oncomplete (fs.js:95:15)' ] }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

npm ERR! Please include the following file with any support request:
npm ERR! /Users/MLS/npm-debug.log

@yunhailu

This comment has been minimized.

Show comment
Hide comment
@yunhailu

yunhailu Sep 10, 2015

我用管理员,也不行,哎,愁死了。。。。

yunhailu commented Sep 10, 2015

我用管理员,也不行,哎,愁死了。。。。

@xiangshouding

This comment has been minimized.

Show comment
Hide comment
@xiangshouding

xiangshouding Sep 10, 2015

Contributor

你可以给适当的权限以达到随心安装,比如

sudo chmod -R 777 /usr/local/

当然,你可能觉着给 777 权限太大了,你可以根据你可控制范围给权限。

Contributor

xiangshouding commented Sep 10, 2015

你可以给适当的权限以达到随心安装,比如

sudo chmod -R 777 /usr/local/

当然,你可能觉着给 777 权限太大了,你可以根据你可控制范围给权限。

@liupeng110112

This comment has been minimized.

Show comment
Hide comment
@liupeng110112

liupeng110112 Sep 16, 2015

basedir=dirname "$0"
^
SyntaxError: Unexpected token ILLEGAL
at Module._compile (module.js:439:25)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Liftoff. (C:\Users\Administrator\AppD
les\fis3\bin\fis.js:26:11)
at Liftoff. (C:\Users\Administrator\AppD
les\fis3\node_modules\liftoff\index.js:185:12)
at Liftoff. (C:\Users\Administrator\AppD
les\fis3\node_modules\liftoff\index.js:153:7)
at process._tickCallback (node.js:415:13)

安装fis3之后报这个错(之前装过fis) 有人遇到过吗

liupeng110112 commented Sep 16, 2015

basedir=dirname "$0"
^
SyntaxError: Unexpected token ILLEGAL
at Module._compile (module.js:439:25)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Liftoff. (C:\Users\Administrator\AppD
les\fis3\bin\fis.js:26:11)
at Liftoff. (C:\Users\Administrator\AppD
les\fis3\node_modules\liftoff\index.js:185:12)
at Liftoff. (C:\Users\Administrator\AppD
les\fis3\node_modules\liftoff\index.js:153:7)
at process._tickCallback (node.js:415:13)

安装fis3之后报这个错(之前装过fis) 有人遇到过吗

@xiangshouding

This comment has been minimized.

Show comment
Hide comment
@xiangshouding

xiangshouding Sep 16, 2015

Contributor

重启你的 cmd 或者什么,再试呢?

Contributor

xiangshouding commented Sep 16, 2015

重启你的 cmd 或者什么,再试呢?

@liupeng110112

This comment has been minimized.

Show comment
Hide comment
@liupeng110112

liupeng110112 Sep 16, 2015

以及重启过了 ,之前装的fis都删掉 以及fis3都删过 查了下没找到原因在哪

liupeng110112 commented Sep 16, 2015

以及重启过了 ,之前装的fis都删掉 以及fis3都删过 查了下没找到原因在哪

@liupeng110112

This comment has been minimized.

Show comment
Hide comment
@liupeng110112

liupeng110112 Sep 18, 2015

@xiangshouding 查了下是说在cmd运行shell脚本报错,我就直接把你npm里的fis这个脚本删掉了 只留了fis.cmd 在运行就没问题了, 但是有个疑问是之前装的fis也有shell脚本 装了fis3之后就报错了

liupeng110112 commented Sep 18, 2015

@xiangshouding 查了下是说在cmd运行shell脚本报错,我就直接把你npm里的fis这个脚本删掉了 只留了fis.cmd 在运行就没问题了, 但是有个疑问是之前装的fis也有shell脚本 装了fis3之后就报错了

@Vengean

This comment has been minimized.

Show comment
Hide comment
@Vengean

Vengean Oct 8, 2015

gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: read ECONNRESET
gyp ERR! stack at exports._errnoException (util.js:746:11)
gyp ERR! stack at TCP.onread (net.js:559:26)
gyp ERR! System Darwin 14.5.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/fis3/node_modules/fis3-command-release/node_modules/chokidar/node_modules/fsevents
gyp ERR! node -v v0.12.7
gyp ERR! node-gyp -v v2.0.1
gyp ERR! not ok

node-pngquant-native@0.2.2 install /usr/local/lib/node_modules/fis3/node_modules/fis-optimizer-png-compressor/node_modules/node-pngquant-native
echo "Hello, World"

Hello, World
npm WARN optional dep failed, continuing fsevents@0.3.8

fsevents@0.3.8 install /usr/local/lib/node_modules/fis3/node_modules/fis-command-server/node_modules/chokidar/node_modules/fsevents
node-gyp rebuild

---------------------------华丽的分割线-------------------------
这是什么问题Mac OS Yosemite,fis3 -v命令显示安装成功了,不影响使用吗?

Vengean commented Oct 8, 2015

gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: read ECONNRESET
gyp ERR! stack at exports._errnoException (util.js:746:11)
gyp ERR! stack at TCP.onread (net.js:559:26)
gyp ERR! System Darwin 14.5.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/fis3/node_modules/fis3-command-release/node_modules/chokidar/node_modules/fsevents
gyp ERR! node -v v0.12.7
gyp ERR! node-gyp -v v2.0.1
gyp ERR! not ok

node-pngquant-native@0.2.2 install /usr/local/lib/node_modules/fis3/node_modules/fis-optimizer-png-compressor/node_modules/node-pngquant-native
echo "Hello, World"

Hello, World
npm WARN optional dep failed, continuing fsevents@0.3.8

fsevents@0.3.8 install /usr/local/lib/node_modules/fis3/node_modules/fis-command-server/node_modules/chokidar/node_modules/fsevents
node-gyp rebuild

---------------------------华丽的分割线-------------------------
这是什么问题Mac OS Yosemite,fis3 -v命令显示安装成功了,不影响使用吗?

@hitao123

This comment has been minimized.

Show comment
Hide comment
@hitao123

hitao123 Jul 18, 2016

@xiangshouding ,你好!我装完之后, 使用 fis3 -v 在windows 命令行出现不是内部命令或者外部命令,需要设置环境变量吗?怎么设置?

hitao123 commented Jul 18, 2016

@xiangshouding ,你好!我装完之后, 使用 fis3 -v 在windows 命令行出现不是内部命令或者外部命令,需要设置环境变量吗?怎么设置?

@xiangshouding

This comment has been minimized.

Show comment
Hide comment
@xiangshouding

xiangshouding Jul 20, 2016

Contributor

环境变量不对,参考搜索引擎

hitao123 notifications@github.com于2016年7月19日周二 上午7:31写道:

@xiangshouding https://github.com/xiangshouding ,你好!我装完之后, 使用 fis3 -v
在windows 命令行出现不是内部命令或者外部命令,需要设置环境变量吗?怎么设置?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#565 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAmhm13-ShECp61mzMTlIwGTJ50vhMqWks5qXAzsgaJpZM4FLYgA
.

Contributor

xiangshouding commented Jul 20, 2016

环境变量不对,参考搜索引擎

hitao123 notifications@github.com于2016年7月19日周二 上午7:31写道:

@xiangshouding https://github.com/xiangshouding ,你好!我装完之后, 使用 fis3 -v
在windows 命令行出现不是内部命令或者外部命令,需要设置环境变量吗?怎么设置?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#565 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAmhm13-ShECp61mzMTlIwGTJ50vhMqWks5qXAzsgaJpZM4FLYgA
.

@dinglittle

This comment has been minimized.

Show comment
Hide comment
@dinglittle

dinglittle Jul 25, 2016

npm ERR! tar.unpack untar error /Users/lwj/.npm/fis3/3.4.17/package.tgz
npm ERR! Darwin 15.5.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "fis3"
npm ERR! node v4.4.7
npm ERR! npm v2.15.8
npm ERR! path /usr/local/lib/node_modules/fis3
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall mkdir

npm ERR! Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/fis3'
npm ERR! at Error (native)
npm ERR! { [Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/fis3']
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'mkdir',
npm ERR! path: '/usr/local/lib/node_modules/fis3',
npm ERR! fstream_type: 'Directory',
npm ERR! fstream_path: '/usr/local/lib/node_modules/fis3',
npm ERR! fstream_class: 'DirWriter',
npm ERR! fstream_stack:
npm ERR! [ '/usr/local/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:35:25',
npm ERR! '/usr/local/lib/node_modules/npm/node_modules/mkdirp/index.js:47:53',
npm ERR! 'FSReqWrap.oncomplete (fs.js:82:15)' ] }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

npm ERR! Please include the following file with any support request:
npm ERR! /Users/lwj/npm-debug.log

MAC 10.11 安装失败 ,求指点

dinglittle commented Jul 25, 2016

npm ERR! tar.unpack untar error /Users/lwj/.npm/fis3/3.4.17/package.tgz
npm ERR! Darwin 15.5.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "fis3"
npm ERR! node v4.4.7
npm ERR! npm v2.15.8
npm ERR! path /usr/local/lib/node_modules/fis3
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall mkdir

npm ERR! Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/fis3'
npm ERR! at Error (native)
npm ERR! { [Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/fis3']
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'mkdir',
npm ERR! path: '/usr/local/lib/node_modules/fis3',
npm ERR! fstream_type: 'Directory',
npm ERR! fstream_path: '/usr/local/lib/node_modules/fis3',
npm ERR! fstream_class: 'DirWriter',
npm ERR! fstream_stack:
npm ERR! [ '/usr/local/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:35:25',
npm ERR! '/usr/local/lib/node_modules/npm/node_modules/mkdirp/index.js:47:53',
npm ERR! 'FSReqWrap.oncomplete (fs.js:82:15)' ] }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

npm ERR! Please include the following file with any support request:
npm ERR! /Users/lwj/npm-debug.log

MAC 10.11 安装失败 ,求指点

@xiangshouding

This comment has been minimized.

Show comment
Hide comment
@xiangshouding

xiangshouding Aug 7, 2016

Contributor

@dinglittle 安装目标路径没有权限,请修改路径权限。

Contributor

xiangshouding commented Aug 7, 2016

@dinglittle 安装目标路径没有权限,请修改路径权限。

@yyttocs

This comment has been minimized.

Show comment
Hide comment
@yyttocs

yyttocs Sep 19, 2016

npm install express
node_modules目录前多了两个 ../../,怎么解决呢

image

yyttocs commented Sep 19, 2016

npm install express
node_modules目录前多了两个 ../../,怎么解决呢

image

@hezeznb

This comment has been minimized.

Show comment
Hide comment
@hezeznb

hezeznb Sep 28, 2016

@soulaxin 问题解决了吗,我跟你报一样的错误

hezeznb commented Sep 28, 2016

@soulaxin 问题解决了吗,我跟你报一样的错误

@hezeznb

This comment has been minimized.

Show comment
Hide comment
@hezeznb

hezeznb Sep 28, 2016

@xiangshouding 这位soulaxin仁兄的问题怎么解决啊怎么也没给解决方案

hezeznb commented Sep 28, 2016

@xiangshouding 这位soulaxin仁兄的问题怎么解决啊怎么也没给解决方案

@2betop

This comment has been minimized.

Show comment
Hide comment
@2betop

2betop Sep 28, 2016

Contributor

npm install 会受父级目录是否有 package.json 文件的影响,这个情况正好是你的 '../../' 目录有个package.json 文件, npm 会认为那个目录是你得工程目录,所以就安装到那了。

解决方法:在你想要得目录 npm init 一下生成新的 package.json 到当前目录,然后再 npm install

Contributor

2betop commented Sep 28, 2016

npm install 会受父级目录是否有 package.json 文件的影响,这个情况正好是你的 '../../' 目录有个package.json 文件, npm 会认为那个目录是你得工程目录,所以就安装到那了。

解决方法:在你想要得目录 npm init 一下生成新的 package.json 到当前目录,然后再 npm install

@yyttocs

This comment has been minimized.

Show comment
Hide comment
@yyttocs

yyttocs Sep 29, 2016

@2betop 谢啦,可以了。

yyttocs commented Sep 29, 2016

@2betop 谢啦,可以了。

@hezeznb

This comment has been minimized.

Show comment
Hide comment
@hezeznb

hezeznb Nov 7, 2016

@xiangshouding 这位soulaxin仁兄的问题怎么解决啊怎么也没给解决方案

hezeznb commented Nov 7, 2016

@xiangshouding 这位soulaxin仁兄的问题怎么解决啊怎么也没给解决方案

@hezeznb

This comment has been minimized.

Show comment
Hide comment
@hezeznb

hezeznb Nov 7, 2016

@xiangshouding 这位soulaxin仁兄的问题怎么解决啊怎么也没给解决方案,怎么问这么多遍都不给解决方案

hezeznb commented Nov 7, 2016

@xiangshouding 这位soulaxin仁兄的问题怎么解决啊怎么也没给解决方案,怎么问这么多遍都不给解决方案

@baiqb

This comment has been minimized.

Show comment
Hide comment
@baiqb

baiqb Nov 29, 2016

@hezeznb 这位soulaxin仁兄的问题,你解决了么?

baiqb commented Nov 29, 2016

@hezeznb 这位soulaxin仁兄的问题,你解决了么?

@xiangshouding

This comment has been minimized.

Show comment
Hide comment
@xiangshouding

xiangshouding Dec 3, 2016

Contributor

@soulaxin @baiqb

这个你们是不是装了什么 cygwin,gow 这样的方案啊,如果没有,谁能把

报错文件那个文件的目录下的内容给我打出来看看?

Contributor

xiangshouding commented Dec 3, 2016

@soulaxin @baiqb

这个你们是不是装了什么 cygwin,gow 这样的方案啊,如果没有,谁能把

报错文件那个文件的目录下的内容给我打出来看看?

@baiqb

This comment has been minimized.

Show comment
Hide comment
@baiqb

baiqb Dec 3, 2016

baiqb commented Dec 3, 2016

@xiejunping

This comment has been minimized.

Show comment
Hide comment
@xiejunping

xiejunping Dec 12, 2016

@soulaxin 问题解决了吗,我跟你报一样的错误

xiejunping commented Dec 12, 2016

@soulaxin 问题解决了吗,我跟你报一样的错误

@xiejunping

This comment has been minimized.

Show comment
Hide comment
@xiejunping

xiejunping Dec 12, 2016

@soulaxin @baiqb @hezeznb 请叫我雷锋!
image

fis = require(path.dirname(__dirname));
改成这样,因为他代码写错了,返回的modulesPath 少了个node_modules

你可以console env 看看,本是没有fis3时返回的路径是啥。

xiejunping commented Dec 12, 2016

@soulaxin @baiqb @hezeznb 请叫我雷锋!
image

fis = require(path.dirname(__dirname));
改成这样,因为他代码写错了,返回的modulesPath 少了个node_modules

你可以console env 看看,本是没有fis3时返回的路径是啥。

@upwardlwy

This comment has been minimized.

Show comment
Hide comment
@upwardlwy

upwardlwy Jan 16, 2017

qq 20170116175202之前已经安装成功了,后面不知道怎么回事,说少了fis.js。重新装还是报这个错,求助(这个文件,可以告诉我在哪去找吗)。

upwardlwy commented Jan 16, 2017

qq 20170116175202之前已经安装成功了,后面不知道怎么回事,说少了fis.js。重新装还是报这个错,求助(这个文件,可以告诉我在哪去找吗)。

@xiangshouding

This comment has been minimized.

Show comment
Hide comment
@xiangshouding

xiangshouding Jan 17, 2017

Contributor

应该你改了环境变量 PATH ?你把环境变量打出来看看%PATH%

@upwardlwy

Contributor

xiangshouding commented Jan 17, 2017

应该你改了环境变量 PATH ?你把环境变量打出来看看%PATH%

@upwardlwy

@liang511

This comment has been minimized.

Show comment
Hide comment
@liang511

liang511 Feb 21, 2017

@zzlsan30 请问fis3 release的时候出现cannot find module 'isarray'这个问题你有解决了吗,我也是把文件拷到内网,执行fis3 -v成功

liang511 commented Feb 21, 2017

@zzlsan30 请问fis3 release的时候出现cannot find module 'isarray'这个问题你有解决了吗,我也是把文件拷到内网,执行fis3 -v成功

@xiangshouding

This comment has been minimized.

Show comment
Hide comment
@xiangshouding

xiangshouding Mar 9, 2017

Contributor

@liang511 没有 copy 全?或者来点更多错误信息

Contributor

xiangshouding commented Mar 9, 2017

@liang511 没有 copy 全?或者来点更多错误信息

@liang511

This comment has been minimized.

Show comment
Hide comment
@liang511

liang511 Mar 9, 2017

@xiangshouding 应该是当时没copy全吧,后来同事重新弄了一份就可以了

liang511 commented Mar 9, 2017

@xiangshouding 应该是当时没copy全吧,后来同事重新弄了一份就可以了

@Mr-funny

This comment has been minimized.

Show comment
Hide comment
@Mr-funny

Mr-funny Jun 3, 2017

C:\Users\FOX\Desktop\vue饿了么实战\seller\build\dev-server.js:36
errno: 0;
^
SyntaxError: Unexpected token ;
at createScript (vm.js:56:10)
at Object.runInThisContext (vm.js:97:10)
at Module._compile (module.js:542:28)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.runMain (module.js:604:10)
at run (bootstrap_node.js:393:7)
at startup (bootstrap_node.js:150:9)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! seller@1.0.0 dev: node build/dev-server.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the seller@1.0.0 dev script 'node build/dev-server.js'.
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 seller package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node build/dev-server.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs seller
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls seller
npm ERR! There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\FOX\AppData\Roaming\npm-cache_logs\2017-06-03T00_56_29_81 5Z-debug.log
有大神帮我解决一下这个是什么错误吗??我新手

Mr-funny commented Jun 3, 2017

C:\Users\FOX\Desktop\vue饿了么实战\seller\build\dev-server.js:36
errno: 0;
^
SyntaxError: Unexpected token ;
at createScript (vm.js:56:10)
at Object.runInThisContext (vm.js:97:10)
at Module._compile (module.js:542:28)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.runMain (module.js:604:10)
at run (bootstrap_node.js:393:7)
at startup (bootstrap_node.js:150:9)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! seller@1.0.0 dev: node build/dev-server.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the seller@1.0.0 dev script 'node build/dev-server.js'.
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 seller package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node build/dev-server.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs seller
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls seller
npm ERR! There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\FOX\AppData\Roaming\npm-cache_logs\2017-06-03T00_56_29_81 5Z-debug.log
有大神帮我解决一下这个是什么错误吗??我新手

@xiangshouding

This comment has been minimized.

Show comment
Hide comment
@xiangshouding

xiangshouding Jun 3, 2017

Contributor
Contributor

xiangshouding commented Jun 3, 2017

@a526672351

This comment has been minimized.

Show comment
Hide comment
@a526672351

a526672351 Jul 19, 2017

为什么fis3本地安装必须./node_modules/.bin/fis3 才能运行,我看egg.js 的本地安装,egg-bin都不用cd进去/node_modules/.bin运行,这是啥原因?

a526672351 commented Jul 19, 2017

为什么fis3本地安装必须./node_modules/.bin/fis3 才能运行,我看egg.js 的本地安装,egg-bin都不用cd进去/node_modules/.bin运行,这是啥原因?

@github-zhang

This comment has been minimized.

Show comment
Hide comment
@github-zhang

github-zhang Jul 21, 2017

fis3 安装,不能用git-hash,只能用CMD

github-zhang commented Jul 21, 2017

fis3 安装,不能用git-hash,只能用CMD

@pigpigever

This comment has been minimized.

Show comment
Hide comment
@pigpigever

pigpigever Sep 6, 2017

你好,我在linux下使用npm全局安装失败,代码诸如:

npm install express -g //或
npm install hexo-cli -g

在这之前我是使用源代码来安装nodejs的,有人知道是怎么回事吗

pigpigever commented Sep 6, 2017

你好,我在linux下使用npm全局安装失败,代码诸如:

npm install express -g //或
npm install hexo-cli -g

在这之前我是使用源代码来安装nodejs的,有人知道是怎么回事吗

@xiangshouding

This comment has been minimized.

Show comment
Hide comment
@xiangshouding

xiangshouding Sep 7, 2017

Contributor

没权限 @pigpigever

Contributor

xiangshouding commented Sep 7, 2017

没权限 @pigpigever

@zhengyixin

This comment has been minimized.

Show comment
Hide comment
@zhengyixin

zhengyixin Nov 13, 2017

安装的时候报错

const Hoek = require('hoek');
^^^^^
SyntaxError: Use of const in strict mode.
at exports.runInThisContext (vm.js:73:16)
at Module._compile (module.js:443:25)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object. (/usr/local/lib/node_modules/fis3/node_modules/fis-optimizer-png-compressor/node_modules/node-pngquant-native/node_modules/request/node_modules/hawk/lib/index.js:5:33)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
npm ERR! Darwin 16.7.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "fis3"
npm ERR! node v0.12.13
npm ERR! npm v2.15.0
npm ERR! code ELIFECYCLE

zhengyixin commented Nov 13, 2017

安装的时候报错

const Hoek = require('hoek');
^^^^^
SyntaxError: Use of const in strict mode.
at exports.runInThisContext (vm.js:73:16)
at Module._compile (module.js:443:25)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object. (/usr/local/lib/node_modules/fis3/node_modules/fis-optimizer-png-compressor/node_modules/node-pngquant-native/node_modules/request/node_modules/hawk/lib/index.js:5:33)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
npm ERR! Darwin 16.7.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "fis3"
npm ERR! node v0.12.13
npm ERR! npm v2.15.0
npm ERR! code ELIFECYCLE

@xiangshouding

This comment has been minimized.

Show comment
Hide comment
@xiangshouding

xiangshouding Nov 13, 2017

Contributor

@zhengyixin

可以参考 Release https://github.com/fex-team/fis3/releases/tag/3.4.38 信息,最新版本支持要求 node 版本 4.x 以上。如果是低于这个版本的,可以安装久版本。

npm install -g fis3@3.4.36
Contributor

xiangshouding commented Nov 13, 2017

@zhengyixin

可以参考 Release https://github.com/fex-team/fis3/releases/tag/3.4.38 信息,最新版本支持要求 node 版本 4.x 以上。如果是低于这个版本的,可以安装久版本。

npm install -g fis3@3.4.36
@wenguangcheng

This comment has been minimized.

Show comment
Hide comment
@wenguangcheng

wenguangcheng Feb 8, 2018

我遇到了这个问题,可以帮我解答一下吗??

就是 fis3 server start 直接报错
C:\Users\domingo.M1>fis3 server start

[INFO] Currently running fis3 (C:\Users\domingo.M1\AppData\Roaming\npm\node_modules\fis3)
fs.js:646
return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
^

Error: EPERM: operation not permitted, open 'C:\Users\domingo.M1\AppData\Local.fis3-tmp\server\conf.json'
at Object.fs.openSync (fs.js:646:18)
at Object.fs.writeFileSync (fs.js:1291:33)
at Function..write (C:\Users\domingo.M1\AppData\Roaming\npm\node_modules\fis3\lib\util.js:733:8)
at Object.
.serverInfo (C:\Users\domingo.M1\AppData\Roaming\npm\node_modules\fis3\node_modules\fis3-command-server\lib\util.js:79:32)
at start (C:\Users\domingo.M1\AppData\Roaming\npm\node_modules\fis3\node_modules\fis3-command-server\lib\server.js:20:8)
at C:\Users\domingo.M1\AppData\Roaming\npm\node_modules\fis3\node_modules\fis3-command-server\lib\server.js:139:21
at ChildProcess. (C:\Users\domingo.M1\AppData\Roaming\npm\node_modules\fis3\node_modules\fis3-command-server\lib\server.js:75:5)
at emitTwo (events.js:126:13)
at ChildProcess.emit (events.js:214:7)
at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)

screenshot_1

谢谢你了

wenguangcheng commented Feb 8, 2018

我遇到了这个问题,可以帮我解答一下吗??

就是 fis3 server start 直接报错
C:\Users\domingo.M1>fis3 server start

[INFO] Currently running fis3 (C:\Users\domingo.M1\AppData\Roaming\npm\node_modules\fis3)
fs.js:646
return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
^

Error: EPERM: operation not permitted, open 'C:\Users\domingo.M1\AppData\Local.fis3-tmp\server\conf.json'
at Object.fs.openSync (fs.js:646:18)
at Object.fs.writeFileSync (fs.js:1291:33)
at Function..write (C:\Users\domingo.M1\AppData\Roaming\npm\node_modules\fis3\lib\util.js:733:8)
at Object.
.serverInfo (C:\Users\domingo.M1\AppData\Roaming\npm\node_modules\fis3\node_modules\fis3-command-server\lib\util.js:79:32)
at start (C:\Users\domingo.M1\AppData\Roaming\npm\node_modules\fis3\node_modules\fis3-command-server\lib\server.js:20:8)
at C:\Users\domingo.M1\AppData\Roaming\npm\node_modules\fis3\node_modules\fis3-command-server\lib\server.js:139:21
at ChildProcess. (C:\Users\domingo.M1\AppData\Roaming\npm\node_modules\fis3\node_modules\fis3-command-server\lib\server.js:75:5)
at emitTwo (events.js:126:13)
at ChildProcess.emit (events.js:214:7)
at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)

screenshot_1

谢谢你了

@baiqb

This comment has been minimized.

Show comment
Hide comment
@baiqb

baiqb Feb 8, 2018

baiqb commented Feb 8, 2018

@wenguangcheng

This comment has been minimized.

Show comment
Hide comment
@wenguangcheng

wenguangcheng Feb 8, 2018

@baiqb 我试过了,不行,还是出现这个问题,然后又重新安装node,重新安装了其他的东西,也不行,直接懵逼了

wenguangcheng commented Feb 8, 2018

@baiqb 我试过了,不行,还是出现这个问题,然后又重新安装node,重新安装了其他的东西,也不行,直接懵逼了

@WangJia-mm

This comment has been minimized.

Show comment
Hide comment
@WangJia-mm

WangJia-mm May 23, 2018

ERR! code 1
npm ERR! Command failed: /usr/bin/git clone --depth=1 -q -b 4.0 git://github.com/gulpjs/gulp.git /Users/wangjia16/.npm/_cacache/tmp/git-clone-84cd56a0
npm ERR! /Users/wangjia16/.npm/_cacache/tmp/git-clone-84cd56a0/.git: Permission denied
npm ERR!

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/wangjia16/.npm/_logs/2018-05-23T13_45_44_405Z-debug.log

WangJia-mm commented May 23, 2018

ERR! code 1
npm ERR! Command failed: /usr/bin/git clone --depth=1 -q -b 4.0 git://github.com/gulpjs/gulp.git /Users/wangjia16/.npm/_cacache/tmp/git-clone-84cd56a0
npm ERR! /Users/wangjia16/.npm/_cacache/tmp/git-clone-84cd56a0/.git: Permission denied
npm ERR!

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/wangjia16/.npm/_logs/2018-05-23T13_45_44_405Z-debug.log

@xiangshouding

This comment has been minimized.

Show comment
Hide comment
@xiangshouding

xiangshouding May 29, 2018

Contributor

@WangJia-mm
/Users/wangjia16/.npm/_cacache/tmp/git-clone-84cd56a0/.git: Permission denied

不是说没权限么,可以把 .npm 目录直接删掉,在来一遍。

Contributor

xiangshouding commented May 29, 2018

@WangJia-mm
/Users/wangjia16/.npm/_cacache/tmp/git-clone-84cd56a0/.git: Permission denied

不是说没权限么,可以把 .npm 目录直接删掉,在来一遍。

@carolcoral

This comment has been minimized.

Show comment
Hide comment
@carolcoral

carolcoral Jul 30, 2018

自己基于jquery封装了一个js脚本,类似jquery使用$一样调用的,在vue项目中使用
import lcript from './lcript'
引入了该脚本,调用里面的方法
lcript.alert('.test')
然后就会一直提示

_lcript2.default.alert is not a function

请问怎么解决?!

封装的脚本地址:https://github.com/carolcoral/Lcript/tree/master/src/js

Have done!

change 'lcript' to 'window.lcript'

carolcoral commented Jul 30, 2018

自己基于jquery封装了一个js脚本,类似jquery使用$一样调用的,在vue项目中使用
import lcript from './lcript'
引入了该脚本,调用里面的方法
lcript.alert('.test')
然后就会一直提示

_lcript2.default.alert is not a function

请问怎么解决?!

封装的脚本地址:https://github.com/carolcoral/Lcript/tree/master/src/js

Have done!

change 'lcript' to 'window.lcript'

@dyoner1

This comment has been minimized.

Show comment
Hide comment
@dyoner1

dyoner1 Sep 6, 2018

image
安装成功了 还是报错

dyoner1 commented Sep 6, 2018

image
安装成功了 还是报错

@xiangshouding

This comment has been minimized.

Show comment
Hide comment
@xiangshouding

xiangshouding Sep 11, 2018

Contributor

@dyoner1 你这个 case 没有遇到过啊

Contributor

xiangshouding commented Sep 11, 2018

@dyoner1 你这个 case 没有遇到过啊

@carolcoral

This comment has been minimized.

Show comment
Hide comment
@carolcoral

carolcoral Sep 11, 2018

@dyoner1 要不是路径问题,要不就死没有这个包,你去安装下或者是修改路径为绝对路径

carolcoral commented Sep 11, 2018

@dyoner1 要不是路径问题,要不就死没有这个包,你去安装下或者是修改路径为绝对路径

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment