npx create-strapi-app my-project --quickstart
I am executing this command and it is trying to download certain libraries from github using npm. Due to security reasons the servers are not allowed access to github, so it is not able to download libraries like libvips. Is there any other way to setup a strapi project so that it could get libraries from any other source ?
Here's the error snippet
npx: installed 91 in 18.847s
Creating a new Strapi application at /home/centos/my-project.
Creating a quickstart project.
Creating files.
Error while installing dependencies:
npm WARN deprecated request#2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated boom#7.3.0: This module has moved and is now available at #hapi/boom. Please update your dependencies as this version is no longer maintained an may contain bugs and security issues.
npm WARN deprecated #formatjs/intl-unified-numberformat#3.3.7: We have renamed the package to #formatjs/intl-numberformat
npm WARN deprecated har-validator#5.1.5: this library is no longer supported
npm WARN deprecated hoek#6.1.3: This module has moved and is now available at #hapi/hoek. Please update your dependencies as this version is no longer maintained an may contain bugs and security issues.
npm WARN deprecated core-js#2.6.11: core-js#<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js#3.
npm WARN deprecated chokidar#2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated popper.js#1.16.1: You can find the new Popper v2 at #popperjs/core, this package is dedicated to the legacy v1
npm WARN deprecated mailcomposer#3.12.0: This project is unmaintained
npm WARN deprecated buildmail#3.10.0: This project is unmaintained
npm WARN deprecated resolve-url#0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated urix#0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated fsevents#1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
info sharp Downloading http://10.157.194.58/sharp/v8.10.0/libvips-8.10.0-linux-x64.tar.br
ERR! sharp tunneling socket could not be established, statusCode=403
info sharp Attempting to build from source via node-gyp but this may fail due to the above error
info sharp Please see https://sharp.pixelplumbing.com/install for required dependencies
../src/common.cc:24:22: fatal error: vips/vips8: No such file or directory
#include <vips/vips8>
^
compilation terminated.
make: *** [Release/obj.target/sharp/src/common.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/home/centos/node-v12.18.4-linux-x64/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:315:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Linux 3.10.0-1127.18.2.el7.x86_64
gyp ERR! command "/home/centos/node-v12.18.4-linux-x64/bin/node" "/home/centos/node-v12.18.4-linux-x64/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/centos/my-project/node_modules/sharp
gyp ERR! node -v v12.18.4
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#~2.1.2 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN notsup Unsupported engine for watchpack-chokidar2#2.0.0: wanted: {"node":"<8.10.0"} (current: {"node":"12.18.4","npm":"6.14.6"})
npm WARN notsup Not compatible with your version of node/npm: watchpack-chokidar2#2.0.0
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#^1.2.7 (node_modules/watchpack-chokidar2/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#^1.2.7 (node_modules/webpack-dev-server/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN strapi-connector-bookshelf#3.2.2 requires a peer of knex#^0.20.0 but none is installed. You must install peer dependencies yourself.
npm WARN #buffetjs/utils#3.3.1 requires a peer of yup#^0.27.0 but none is installed. You must install peer dependencies yourself.
npm WARN bootstrap#4.5.2 requires a peer of jquery#1.9.1 - 3 but none is installed. You must install peer dependencies yourself.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sharp#0.26.0 install: `(node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sharp#0.26.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! /home/centos/.npm/_logs/2020-10-09T11_07_28_305Z-debug.log
Keep trying!
Oh, it seems that you encountered errors while installing dependencies in your project.
Don't give up, your project was created correctly.
Fix the issues mentionned in the installation errors and try to run the following command:
cd /home/centos/my-project && npm install
This helps for me.
Open MAC terminal and use these commands:
npm cache clean --force
npx create-strapi-app
npm i
npm run develop
I had the same problem, try here:
https://github.com/nodejs/node-gyp/blob/master/macOS_Catalina.md#Solutions
After, that still had problem with installation and deleted .npm/_libvips/libvips-8.10.0-darwin-x64.tar.br file and installed npx create-strapi-app my-project --quickstart everything was ok
i have problem in installing dependencies
my operation system is windows 11
tested with node v14 and v16
tested with npm v6 and v8
tested with yarn npx and npm
no one working
i just stuck in line bellow for hours
warning "#strapi/strapi > #strapi/admin > webpack-dev-server > http-proxy-middleware#2.0.2" has unmet peer dependency "#types/express#^4.17.13".
warning "#strapi/plugin-users-permissions > grant-koa#5.4.8" has unmet peer dependency "koa#>=2.0.0".
warning Workspaces can only be enabled in private projects.
[5/5] Building fresh packages...
[-/9] ⠠ waiting...
[-/9] ⠠ waiting...
[-/9] ⠠ waiting...
[4/9] ⠠ sharp
[-/9] ⠐ waiting...
What worked for me was as simple as adding a yarn.lock file to the root of your project and running yarn install and finally run yarn start, your project should start successfully
I know the thread is pretty old but I came across the same issue while trying to install Strapi on a Windows 10 local development enviroment using MySQL Database through npm, even though some of the posted answers in this thread helped me to get a better understanding of the issue for my specific case the solution was as follow:
In phpMyAdmin
Create a new MySQL DB Schema and user for the project, this will be the Database and User to be entered during the npx installation process
In Windows PowerShell (as admin)
npx create-strapi-app#latest my-project
cd my-project
npm install
npm run develop
These are the npm, node and MySQL version I used to install Strapi locally:
npm Vers. 6.14.17 check your version using npm -v
node.js Vers. 14.20.0 check your version using node -v
MySQL Vers. 10.4.24-MariaDB
Strapi should run by defult at http://localhost:1337/admin
To change the port it would be needed to edit the .env file at your project root directory.
I was having similar issues, tried a bunch of stuff. Ran this code in the terminal and it solved all of my issues:
sudo apt-get install build-essential apt-transport-https lsb-release ca-certificates curl -y
Related
I have a serverless application and I'm trying to use Bitbucket pipeline to create a build,
I'm using atlassian/default-image:3 image for the Pipeline image,
It comes pre installed with node and few other useful libraries.
The pre installed Node and npm versions are as follows -
Node - v14.17.5
npm - 6.14.14
While trying to install serverless using the command -
npm install -g serverless
I'm getting the following error -
npm WARN deprecated querystring#0.2.1: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated querystring#0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated superagent#7.1.6: Please downgrade to v7.1.5 if you need IE/ActiveXObject support OR upgrade to v8.0.0 as we no longer support IE and published an incorrect patch version (see https://github.com/visionmedia/superagent/issues/1731)
/root/.nvm/versions/node/v14.17.5/bin/serverless -> /root/.nvm/versions/node/v14.17.5/lib/node_modules/serverless/bin/serverless.js
/root/.nvm/versions/node/v14.17.5/bin/sls -> /root/.nvm/versions/node/v14.17.5/lib/node_modules/serverless/bin/serverless.js
> es5-ext#0.10.62 postinstall /root/.nvm/versions/node/v14.17.5/lib/node_modules/serverless/node_modules/es5-ext
> node -e "try{require('./_postinstall')}catch(e){}" || exit 0
sh: 1: node: Permission denied
> serverless#3.25.1 postinstall /root/.nvm/versions/node/v14.17.5/lib/node_modules/serverless
> node ./scripts/postinstall.js
sh: 1: node: Permission denied
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#~2.3.2 (node_modules/serverless/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! serverless#3.25.1 postinstall: `node ./scripts/postinstall.js`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the serverless#3.25.1 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! /root/.npm/_logs/2022-12-14T06_11_03_877Z-debug.log
Check node version being used (node --version). I use nvm and was currently switched to an older vesion of node and got same error. After installing and switching to node v19.3.0 (latest at time of posting) the nom install serverless worked.
I'm trying to install Expo CLI to set up the development environment for React Native but I keep getting this warning when I enter "npm install -g expo-cli" into my terminal:
npm WARN EBADENGINE required: { node: '>=12 <=16' },
npm WARN EBADENGINE current: { node: 'v18.2.0', npm: '8.9.0' }
Previously, trying to install Expo CLI with npm would throw errors like
npm ERR! code EACCES
npm ERR! syscall rename
npm ERR! path /usr/local/lib/node_modules/expo-cli
npm ERR! dest /usr/local/lib/node_modules/.expo-cli-dKBr48UN
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, rename '/usr/local/lib/node_modules/expo-cli' -> '/usr/local/lib/node_modules/.expo-cli-dKBr48UN'
npm ERR! [Error: EACCES: permission denied, rename '/usr/local/lib/node_modules/expo-cli' -> '/usr/local/lib/node_modules/.expo-cli-dKBr48UN'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'rename',
npm ERR! path: '/usr/local/lib/node_modules/expo-cli',
npm ERR! dest: '/usr/local/lib/node_modules/.expo-cli-dKBr48UN'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.
Then I tried the NVM solution in this post which asked me to uninstall node and then install NVM so that doing things like writing in my npm directory wouldn't ask for permission, but now I'm unsure what to do.
edit:
I followed this website to change my node version to v14.19.3 but now there are these warnings:
npm WARN deprecated subscriptions-transport-ws#0.9.8: The `subscriptions-transport-ws` package is no longer maintained. We recommend you use `graphql-ws` instead. For help migrating Apollo software to `graphql-ws`, see https://www.apollographql.com/docs/apollo-server/data/subscriptions/#switching-from-subscriptions-transport-ws For general help using `graphql-ws`, see https://github.com/enisdenjo/graphql-ws/blob/master/README.md
npm WARN deprecated graphql-tools#3.0.0: This package has been deprecated and now it only exports makeExecutableSchema.\nAnd it will no longer receive updates.\nWe recommend you to migrate to scoped packages such as #graphql-tools/schema, #graphql-tools/utils and etc.\nCheck out https://www.graphql-tools.com to learn what package you should use instead
npm WARN deprecated uuid#3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm WARN deprecated svgo#1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x.
npm WARN deprecated source-map-resolve#0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated source-map-url#0.4.1: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated resolve-url#0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated urix#0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated querystring#0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated chokidar#2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
npm WARN deprecated fsevents#1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
/Users/zoeylee/.nvm/versions/node/v14.19.3/bin/expo -> /Users/zoeylee/.nvm/versions/node/v14.19.3/lib/node_modules/expo-cli/bin/expo.js
/Users/zoeylee/.nvm/versions/node/v14.19.3/bin/expo-cli -> /Users/zoeylee/.nvm/versions/node/v14.19.3/lib/node_modules/expo-cli/bin/expo.js
npm WARN ajv-keywords#3.5.2 requires a peer of ajv#^6.9.1 but none is installed. You must install peer dependencies yourself.
I'm a new user and programmer so any advice/help is appreciated, thanks!
You are using 18.2.0, but the message says it requires >=12 <=16 (greater than 12 and less than 16. Not 18.2.0 or greater.
If it's your package.json with the engines field causing this issue, change it to say 12.0.0 or greater:
"engines": {
"node": ">=12.0.0"
},
I am trying to install aws-azure-login. I have to follow with Linux -> Option B: Install Only for Current User.
Then I ran this command:
sudo npm install -g aws-azure-login
I've got this output here:
GGNXFB3:~$ sudo npm install -g aws-azure-login
npm WARN deprecated uuid#3.3.2: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm WARN deprecated querystring#0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
/usr/local/bin/aws-azure-login -> /usr/local/lib/node_modules/aws-azure-login/lib/index.js
> puppeteer#10.2.0 install /usr/local/lib/node_modules/aws-azure-login/node_modules/puppeteer
> node install.js
ERROR: Failed to set up Chromium r901912! Set "PUPPETEER_SKIP_DOWNLOAD" env variable to skip download.
{ [Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/aws-azure-login/node_modules/puppeteer/.local-chromium']
errno: -13,
code: 'EACCES',
syscall: 'mkdir',
path:
'/usr/local/lib/node_modules/aws-azure-login/node_modules/puppeteer/.local-chromium' }
npm WARN notsup Unsupported engine for aws-azure-login#3.4.0: wanted: {"node":">=12.0"} (current: {"node":"10.19.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: aws-azure-login#3.4.0
npm WARN notsup Unsupported engine for commander#8.1.0: wanted: {"node":">= 12"} (current: {"node":"10.19.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: commander#8.1.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! puppeteer#10.2.0 install: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the puppeteer#10.2.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! /root/.npm/_logs/2021-08-18T00_37_04_178Z-debug.log
GGNXFB3:~$
Anyone has had success with this?
You need to make sure about the following things first:
Upgrade your Node.Js from 10.19.0 to >=12.0
Check if you have done the puppeteer dependency installation before npm installing aws-azure-login.
The list of required packages is listed here on puppeteer's Troubleshooting document per Linux system (Debian or CentOS). E.g.:
sudo apt-get install gconf-service libasound2 libatk1.0-0 libatk-bridge2.0-0 ...
(But make sure you add all the relevant packages!)
I have tried everything. Looking at "PATH" variable in windows 10
-reinstalled node multiple times and multiple versions
-removed all node files and npm files from the program folder and the AppData and user folder.
-I finally got the react app to work but then when every I do "npm start" it gives me the errors.
-I have deleted node modules and package-lock.json file as well and still no solution.
PS C:\Users\Imran\Desktop\zertomastery\19_react\maryam1> npm start
> maryam1#0.1.0 start
> react-scripts start
npm ERR! code ENOENT
npm ERR! syscall spawn bash
npm ERR! path C:\Users\Imran\Desktop\zertomastery\19_react\maryam1
npm ERR! errno -4058
npm ERR! enoent spawn bash ENOENT
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Imran\AppData\Local\npm-cache\_logs\2021-07-18T18_17_31_571Z-debug.log-debug.log
PS C:\Users\Imran\Desktop\zertomastery\19_react\maryam1>
I have deleted the node_modules folder and the package-lock.json and done npm install
-results of npm install after deleting node_modules and package.json.
PS C:\Users\Imran\Desktop\zertomastery\19_react\maryam1> npm start > npm install
npm WARN deprecated #hapi/bourne#1.3.2: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated #hapi/topo#3.1.6: This version has
been deprecated and is no longer supported or maintained act\maryam1
npm WARN deprecated urix#0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated resolve-url#0.2.1: https://github.co find a file.om/lydell/resolve-url#deprecated
npm WARN deprecated querystring#0.2.1: The querystring
API is considered Legacy. new code should use the URLSearchParams API instead. 18_17_31_571Z-debug.log
npm WARN deprecated chokidar#2.1.8: Chokidar 2 will bregs\2021-07-18Tak on node v14+. Upgrade to chokidar 3 with 15x less dependencies. >
npm WARN deprecated chokidar#2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated querystring#0.2.0: The querystring
API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated sane#4.1.0: some dependency vulnerabilities fixed, support for node < 10 dropped, and newer ECMAScript syntax/features added
npm WARN deprecated #hapi/address#2.1.4: Moved to 'npm
install #sideway/address'
npm WARN deprecated babel-eslint#10.1.0: babel-eslint is now #babel/eslint-parser. This package will no longer receive updates.
npm WARN deprecated rollup-plugin-babel#4.4.0: This package has been deprecated and is no longer maintained. Please use #rollup/plugin-babel.
npm WARN deprecated uuid#3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random()
in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm WARN deprecated uuid#3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random()
in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm WARN deprecated #hapi/hoek#8.5.1: This version has
been deprecated and is no longer supported or maintained
npm WARN deprecated #hapi/joi#15.1.1: Switch to 'npm install joi'
npm WARN deprecated core-js#2.6.12: core-js#<3.3 is no
longer maintained and not recommended for usage due to
the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a
slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of
core-js.
npm ERR! code ENOENT
npm ERR! syscall spawn bash
npm ERR! path C:\Users\Imran\Desktop\zertomastery\19_react\maryam1\node_modules\core-js
npm ERR! errno -4058
npm ERR! enoent spawn bash ENOENT
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Imran\AppData\Local\npm-cache\_logs\2021-07-18T18_22_24_801Z-debug.log
PS C:\Users\Imran\Desktop\zertomastery\19_react\maryam1
after doing allot of commands and things I am not getting this when do "npm start" I switched to bash
Imran#DESKTOP-3331IKE MINGW64 ~/Desktop/zertomastery/19_react/maryam1 (main)
$ npm start
> maryam1#0.1.0 start
> react-scripts start
node:internal/modules/cjs/loader:355
throw err;
^
Error: Cannot find module 'C:\Users\Imran\Desktop\zertomastery\19_react\maryam1\node_modules\loader-runner\lib\LoaderRunner.js'. Please verify that the package.json has a valid "main" entry
at tryPackage (node:internal/modules/cjs/loader:347:19)
at Function.Module._findPath (node:internal/modules/cjs/loader:560:18)
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:913:27)
at Function.Module._load (node:internal/modules/cjs/loader:772:27)
at Module.require (node:internal/modules/cjs/loader:999:19)
at require (node:internal/modules/cjs/helpers:93:18)
at Object.<anonymous> (C:\Users\Imran\Desktop\zertomastery\19_react\maryam1\node_modules\webpack\lib\NormalModule.js:16:36)
at Module._compile (node:internal/modules/cjs/loader:1095:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1124:10)
at Module.load (node:internal/modules/cjs/loader:975:32) {
code: 'MODULE_NOT_FOUND',
path: 'C:\\Users\\Imran\\Desktop\\zertomastery\\19_react\\maryam1\\node_modules\\loader-runner\\package.json',
requestPath: 'loader-runner'
}
Imran#DESKTOP-3331IKE MINGW64 ~/Desktop/zertomastery/19_react/maryam1 (main)
$
Try This,
npm cache clean
npm install
npm start
When I try to install firebase-tools with:
npm install -g firebase-tools
I get the following error:
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
I have googled this error but haven't found anything related. What can I do to install firebase-tools?
Reason: You used used snap to install node and snap does not allows apps to write to /usr/local and this is where all the global packages are installed.
What you can do to fix this?
snap remove node - uninstall the snap version of node
sudo apt-get install nodejs - install nodejs
npm install -g firebase-tools - this should work now
i had the same problem but i fixed it by not installing it globally
try this
npm install firebase-tools
or
sudo npm install -g firebase-tools