Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/oop/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
无法使用npm安装firebase CLI_Npm_Npm Install - Fatal编程技术网

无法使用npm安装firebase CLI

无法使用npm安装firebase CLI,npm,npm-install,Npm,Npm Install,当我尝试使用以下工具安装firebase tools时: npm install -g firebase-tools 我得到以下错误: npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142 npm WARN deprecated mkdirp@0.5.4: Legacy versions of mkdirp are n

当我尝试使用以下工具安装
firebase tools
时:

npm install -g firebase-tools
我得到以下错误:

npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated mkdirp@0.5.4: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
/usr/local/bin/firebase -> /usr/local/lib/node_modules/firebase-tools/lib/bin/firebase.js
npm WARN lifecycle The node binary used for scripts is /snap/bin/node but npm is using /snap/node/2609/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.

> protobufjs@6.8.9 postinstall /usr/local/lib/node_modules/firebase-tools/node_modules/protobufjs
> node scripts/postinstall

2020/03/31 16:23:53.220338 cmd_run.go:884: WARNING: cannot create user data directory: cannot create "/nonexistent/snap/node/2609": mkdir /nonexistent: permission denied
cannot create user data directory: /nonexistent/snap/node/2609: Permission denied
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.1.2 (node_modules/firebase-tools/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! protobufjs@6.8.9 postinstall: `node scripts/postinstall`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the protobufjs@6.8.9 postinstall 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!     /home/david/.npm/_logs/2020-03-31T21_23_53_670Z-debug.log

我在谷歌上搜索了这个错误,但没有找到任何相关的。如何安装
firebase tools

我也有同样的问题,但我通过不全局安装来修复了它

试试这个 npm安装firebase工具


sudo npm install-g firebase tools

我也遇到了同样的问题,但我通过不全局安装来修复了它

试试这个 npm安装firebase工具


sudo npm install-g firebase tools原因:您使用snap安装节点,snap不允许应用程序写入
/usr/local
,这是安装所有全局软件包的地方

你能做些什么来解决这个问题

  • 快照删除节点
    -卸载节点的快照版本
  • sudo apt get install nodejs
    -安装nodejs
  • npm安装-g firebase工具
    -现在应该可以工作了

  • 原因:您使用snap安装节点,snap不允许应用程序写入
    /usr/local
    ,这是安装所有全局软件包的地方

    你能做些什么来解决这个问题

  • 快照删除节点
    -卸载节点的快照版本
  • sudo apt get install nodejs
    -安装nodejs
  • npm安装-g firebase工具
    -现在应该可以工作了

  • 我在安装Firebase时遇到同样的问题我在安装Firebase时遇到同样的问题确保并在根项目文件夹中执行此操作确保并在根项目文件夹中执行此操作