Cannot install tensorflow js - tensorflow

I am trying to install tensorflow dependency but I am getting an error in the terminal console.
My package.json:
{
"name": "knn-tf",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"#tensorflow/tfjs-node": "^0.1.17",
"lodash": "^4.17.11",
"shuffle-seed": "^1.1.6"
}
}
* Building TensorFlow Node.js bindings
/Users/mateusz/WebstormProjects/ML_JS/MLKits/knn-tf/node_modules/#tensorflow/tfjs-node/scripts/install.js:154
throw new Error('node-gyp rebuild failed with: ' + err);
^
Error: node-gyp rebuild failed with: Error: Command failed: node-gyp rebuild
No receipt for 'com.apple.pkg.CLTools_Executables' found at '/'.
No receipt for 'com.apple.pkg.DeveloperToolsCLILeo' found at '/'.
No receipt for 'com.apple.pkg.DeveloperToolsCLI' found at '/'.
gyp: No Xcode or CLT version detected!
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack at ChildProcess.emit (events.js:210:5)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Darwin 19.5.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/mateusz/WebstormProjects/ML_JS/MLKits/knn-tf/node_modules/#tensorflow/tfjs-node
gyp ERR! node -v v12.13.0
gyp ERR! node-gyp -v v5.0.7
gyp ERR! not ok
at /Users/mateusz/WebstormProjects/ML_JS/MLKits/knn-tf/node_modules/#tensorflow/tfjs-node/scripts/install.js:154:13
at ChildProcess.exithandler (child_process.js:302:5)
at ChildProcess.emit (events.js:210:5)
at maybeClose (internal/child_process.js:1021:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
npm WARN knn-tf#1.0.0 No description
npm WARN knn-tf#1.0.0 No repository field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! #tensorflow/tfjs-node#0.1.21 install: `node scripts/install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the #tensorflow/tfjs-node#0.1.21 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! /Users/mateusz/.npm/_logs/2020-06-05T21_16_30_200Z-debug.log
This occurs when I am running npm i
I have tried to remove the node_modules and install it from scratches but It has not helped.
Do you have an idea how to fix it?

some node modules are using node-gyp to compile their code.
in your case, you are using macos so you need to install compilation tools for macos.
you can do that by installing command line tools. this can be done easily by executing
xcode-select --install
or installing xcode from the app store
once the command line tools are installed, re-run npm install (will advise you to delete node_module directory before)

Related

Sharp returning errors on npm install for M1 Big Sur

I'm trying to install sharp for my project. When running npm i and npm install sharp, I am receiving the same errors about sharp (shown below). I've tried installing libvip globally and locally, and read about every thread about this issue and cannot seem to find the right solution. Any suggestions are welcome.
rosetta error: /var/db/oah/223263137464320_223263137464320/e6ddd63cd8fd3b7ef226e2cad9a1bead9d7f41f60d7ece6edd0cdcc0c33c97c6/libxcrun.dylib.aot: attachment of code signature supplement failed: 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: null
gyp ERR! stack at ChildProcess.onExit (/Users/elektra.murphy/.nvm/versions/node/v11.11.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack at ChildProcess.emit (events.js:197:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:254:12)
gyp ERR! System Darwin 20.6.0
gyp ERR! command "/Users/elektra.murphy/.nvm/versions/node/v11.11.0/bin/node" "/Users/elektra.murphy/.nvm/versions/node/v11.11.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/elektra.murphy/Desktop/Projects/node_modules/sharp
gyp ERR! node -v v11.11.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm WARN enoent ENOENT: no such file or directory, open '/Users/elektra.murphy/Desktop/Projects/package.json'
npm WARN No description
npm WARN No repository field.
npm WARN No README data
npm WARN No license field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sharp#0.23.2 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.23.2 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! /Users/elektra.murphy/.npm/_logs/2021-10-12T08_24_48_579Z-debug.log
Found a solution for this in the Sharp docs: When using npm v6 or earlier, the npm install --unsafe-perm flag must be used when installing as root or a sudo user. Seems to have worked - now on to the next error!
Find more here on M1 installations:
https://sharp.pixelplumbing.com/install

Unable to install dependencies on my gatsby dev blog

I'm having trouble starting my gatsby bee-starter dev blog. I just cloned it from my repository after installing Ubuntu 20.04LTS on my system. Usually it works by npm start but I don't know it does not. I also tried npm install but no. After I tried to install gatsby-plugin-manifest but again, I keep getting errors like ELIFECYCLE. I don't really understand what that means. Could someone help me out and figure out what's really going on? Thanks!
localhost#localhost:~/Desktop/devBlog$ npm install
> sharp#0.21.3 install /home/hellRaiser/Desktop/devBlog/node_modules/sharp
> (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)
info sharp Using cached /home/hellRaiser/.npm/_libvips/libvips-8.7.0-linux-x64.tar.gz
prebuild-install WARN install No prebuilt binaries found (target=12.16.2 runtime=node arch=x64 libc= platform=linux)
gyp ERR! build error
gyp ERR! stack Error: not found: make
gyp ERR! stack at getNotFoundError (/usr/lib/node_modules/npm/node_modules/which/which.js:13:12)
gyp ERR! stack at F (/usr/lib/node_modules/npm/node_modules/which/which.js:68:19)
gyp ERR! stack at E (/usr/lib/node_modules/npm/node_modules/which/which.js:80:29)
gyp ERR! stack at /usr/lib/node_modules/npm/node_modules/which/which.js:89:16
gyp ERR! stack at /usr/lib/node_modules/npm/node_modules/isexe/index.js:42:5
gyp ERR! stack at /usr/lib/node_modules/npm/node_modules/isexe/mode.js:8:5
gyp ERR! stack at FSReqCallback.oncomplete (fs.js:167:21)
gyp ERR! System Linux 5.4.0-26-generic
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/hellRaiser/Desktop/devBlog/node_modules/sharp
gyp ERR! node -v v12.16.2
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.7 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sharp#0.21.3 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.21.3 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/hellRaiser/.npm/_logs/2020-05-01T13_25_04_789Z-debug.log
localhost#localhost:~/Desktop/devBlog$ npm start
> gatsby-starter-bee#0.1.0 start /home/hellRaiser/Desktop/devBlog
> npm run develop
> gatsby-starter-bee#0.1.0 develop /home/hellRaiser/Desktop/devBlog
> gatsby develop
success open and validate gatsby-configs — 0.005 s
error UNHANDLED REJECTION
Error: Unable to find plugin "gatsby-plugin-manifest". Perhaps you need to install its package?
- load.js:107 resolvePlugin
[devBlog]/[gatsby]/dist/bootstrap/load-plugins/load.js:107:11
- load.js:150 processPlugin
[devBlog]/[gatsby]/dist/bootstrap/load-plugins/load.js:150:20
- load.js:169
[devBlog]/[gatsby]/dist/bootstrap/load-plugins/load.js:169:20
- Array.forEach
- load.js:168 module.exports
[devBlog]/[gatsby]/dist/bootstrap/load-plugins/load.js:168:20
- index.js:56
[devBlog]/[gatsby]/dist/bootstrap/load-plugins/index.js:56:21
- Generator.next
- new Promise
- index.js:96
[devBlog]/[gatsby]/dist/bootstrap/load-plugins/index.js:96:17
- index.js:126
[devBlog]/[gatsby]/dist/bootstrap/index.js:126:36
- Generator.next
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! gatsby-starter-bee#0.1.0 develop: `gatsby develop`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the gatsby-starter-bee#0.1.0 develop 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/hellRaiser/.npm/_logs/2020-05-01T13_32_13_638Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! gatsby-starter-bee#0.1.0 start: `npm run develop`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the gatsby-starter-bee#0.1.0 start 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/hellRaiser/.npm/_logs/2020-05-01T13_32_13_723Z-debug.log
localhost#localhost:~/Desktop/devBlog$ npm install gatsby-plugin-manifest
> sharp#0.21.3 install /home/hellRaiser/Desktop/devBlog/node_modules/sharp
> (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)
info sharp Using cached /home/hellRaiser/.npm/_libvips/libvips-8.7.0-linux-x64.tar.gz
prebuild-install WARN install No prebuilt binaries found (target=12.16.2 runtime=node arch=x64 libc= platform=linux)
gyp ERR! build error
gyp ERR! stack Error: not found: make
gyp ERR! stack at getNotFoundError (/usr/lib/node_modules/npm/node_modules/which/which.js:13:12)
gyp ERR! stack at F (/usr/lib/node_modules/npm/node_modules/which/which.js:68:19)
gyp ERR! stack at E (/usr/lib/node_modules/npm/node_modules/which/which.js:80:29)
gyp ERR! stack at /usr/lib/node_modules/npm/node_modules/which/which.js:89:16
gyp ERR! stack at /usr/lib/node_modules/npm/node_modules/isexe/index.js:42:5
gyp ERR! stack at /usr/lib/node_modules/npm/node_modules/isexe/mode.js:8:5
gyp ERR! stack at FSReqCallback.oncomplete (fs.js:167:21)
gyp ERR! System Linux 5.4.0-26-generic
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/hellRaiser/Desktop/devBlog/node_modules/sharp
gyp ERR! node -v v12.16.2
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
npm WARN ajv-keywords#3.4.0 requires a peer of ajv#^6.9.1 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-plugin-graphql#2.1.1 requires a peer of graphql#^0.12.0 || ^0.13.0 but none is installed. You must install peer dependencies yourself.
npm WARN express-graphql#0.6.12 requires a peer of graphql#^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 but none is installed. You must install peer dependencies yourself.
npm WARN graphql-tools#3.1.1 requires a peer of graphql#^0.13.0 but none is installed. You must install peer dependencies yourself.
npm WARN gatsby-plugin-manifest#2.4.1 requires a peer of gatsby#^2.4.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.7 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sharp#0.21.3 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.21.3 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/hellRaiser/.npm/_logs/2020-05-01T13_33_06_861Z-debug.log
package.json
{
"name": "gatsby-starter-bee",
"private": true,
"description": "Gatsby blog starter template",
"version": "0.1.0",
"author": "Jbee[JaeYeopHan]<ljyhanll#gmail.com>",
"bugs": {
"url": "https://github.com/JaeYeopHan/gatsby-starter-bee/issues"
},
"dependencies": {
"gatsby": "^2.2.8",
"gatsby-image": "^2.0.34",
"gatsby-plugin-feed": "^2.1.0",
"gatsby-plugin-google-analytics": "^2.0.17",
"gatsby-plugin-lodash": "^3.0.5",
"gatsby-plugin-manifest": "^2.0.24",
"gatsby-plugin-offline": "^2.0.25",
"gatsby-plugin-react-helmet": "^3.0.10",
"gatsby-plugin-sass": "^2.0.11",
"gatsby-plugin-sharp": "^2.0.30",
"gatsby-plugin-sitemap": "^2.0.10",
"gatsby-plugin-typography": "^2.2.10",
"gatsby-remark-autolink-headers": "^2.0.16",
"gatsby-remark-copy-linked-files": "^2.0.11",
"gatsby-remark-emoji": "0.0.2",
"gatsby-remark-images": "^3.0.10",
"gatsby-remark-images-medium-zoom": "^1.2.1",
"gatsby-remark-prismjs": "^3.2.6",
"gatsby-remark-responsive-iframe": "^2.1.1",
"gatsby-remark-smartypants": "^2.0.9",
"gatsby-source-filesystem": "^2.0.28",
"gatsby-transformer-remark": "^2.3.8",
"gatsby-transformer-sharp": "^2.1.17",
"intersection-observer": "^0.5.1",
"lodash": "^4.17.11",
"node-sass": "^4.11.0",
"prismjs": "^1.15.0",
"react": "^16.8.1",
"react-disqus-comments": "^1.4.0",
"react-dom": "^16.8.1",
"react-helmet": "^5.2.0",
"react-switch": "^5.0.0",
"react-typography": "^0.16.13",
"smooth-scroll": "^16.0.0",
"typeface-catamaran": "0.0.54",
"typeface-merriweather": "0.0.72",
"typeface-montserrat": "0.0.54",
"typeface-noto-sans-kr": "0.0.63",
"typography": "^0.16.17",
"typography-theme-github": "^0.16.18"
},
"devDependencies": {
"date-fns": "^1.30.1",
"eslint": "^5.14.1",
"eslint-plugin-react": "^7.11.1",
"fs-extra": "^7.0.1",
"gray-matter": "^4.0.2",
"inquirer": "^6.2.2",
"lighthousebot": "git+https://github.com/GoogleChromeLabs/lighthousebot.git",
"prettier": "^1.14.2",
"recursive-readdir": "^2.2.2",
"signale": "^1.3.0"
},
"homepage": "https://github.com/JaeYeopHan/gatsby-starter-bee#readme",
"keywords": [
"gatsby"
],
"license": "MIT",
"main": "n/a",
"repository": {
"type": "git",
"url": "git+https://github.com/JaeYeopHan/gatsby-starter-bee.git"
},
"scripts": {
"post": "node ./cli/create-new-post.js",
"dev": "gatsby develop",
"lint": "eslint --ext .js,.jsx --ignore-pattern public .",
"deploy": "gatsby build && gh-pages -d public -b master -r 'git#github.com:${50904633}/${github page name}.github.io.git'",
"format": "prettier --trailing-comma es5 --no-semi --single-quote --write 'src/**/*.js' 'src/**/*.md'",
"develop": "gatsby develop",
"start": "npm run develop",
"build": "gatsby build",
"lh": "lighthousebot",
"fix-semi": "eslint --quiet --ignore-pattern node_modules --ignore-pattern public --parser babel-eslint --no-eslintrc --rule '{\"semi\": [2, \"never\"], \"no-extra-semi\": [2]}' --fix gatsby-node.js"
}
}
npm start is not universal. It depends on the scripts defined in package.json.
The easiest way to get starting is to install gatsby-cli:
npm install -g gatsby-cli
Then just follow the instructions on the starter page:
gatsby new gatsby-starter-bee https://github.com/JaeYeopHan/gatsby-starter-bee
It should download and install everything. Then just:
cd gatsby-starter-bee
gatsby develop
And you should have a working development site on localhost.

Gatsby failing to install with Starter. Build error

Hi I would like to use a gatsby starter for a blog site. However when I use the command gatbsy new [name-of-project] [url-of-starter]
It shows these errors.
fatal error: too many errors emitted, stopping now [-ferror-limit=]
1 warning and 20 errors generated.
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 (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:196:23)
gyp ERR! stack at ChildProcess.emit (events.js:203:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Darwin 18.6.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/david/Desktop/blog/node_modules/sharp
gyp ERR! node -v v12.8.1
gyp ERR! node-gyp -v v5.0.3
gyp ERR! not ok
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.7 (node_modules/fsevents):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.7 install: `node install`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sharp#0.21.3 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.21.3 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:
ERROR
Command failed with exit code 1 (EPERM): npm install
Error: Command failed with exit code 1 (EPERM): npm install
- error.js:58 makeError
[lib]/[gatsby-cli]/[execa]/lib/error.js:58:11
- index.js:112 handlePromise
[lib]/[gatsby-cli]/[execa]/index.js:112:26
- task_queues.js:85 processTicksAndRejections
internal/process/task_queues.js:85:5
I have tried uninstalling gatsby cli, yarn and npm to no prevail.
Thanks for any advice.
And the default starter works fine its when I use a starter thats the issue.

Can not Install sharp

sharp#0.18.4 install C:\Users\hp\AppData\Roaming\npm\node_modules\sharp
node-gyp rebuild
C:\Users\hp\AppData\Roaming\npm\node_modules\sharp>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "" rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
MSBUILD : error MSB4132: The tools version "2.0" is unrecognized. Available tools versions are "4.0".
gyp ERR! build error
gyp ERR! stack Error: `C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:258:23)
gyp ERR! stack at emitTwo (events.js:126:13)
gyp ERR! stack at ChildProcess.emit (events.js:214:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Windows_NT 10.0.10240
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\hp\AppData\Roaming\npm\node_modules\sharp
gyp ERR! node -v v8.9.3
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm WARN Error: EPERM: operation not permitted, rmdir 'C:\Users\hp\AppData\Roaming\npm\node_modules'
npm WARN { Error: EPERM: operation not permitted, rmdir 'C:\Users\hp\AppData\Roaming\npm\node_modules'
npm WARN stack: 'Error: EPERM: operation not permitted, rmdir \'C:\\Users\\hp\\AppData\\Roaming\\npm\\node_modules\'',
npm WARN errno: -4048,
npm WARN code: 'EPERM',
npm WARN syscall: 'rmdir',
npm WARN path: 'C:\\Users\\hp\\AppData\\Roaming\\npm\\node_modules' }
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sharp#0.18.4 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sharp#0.18.4 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\hp\AppData\Roaming\npm-cache\_logs\2017-12-27T19_25_54_261Z-debug.log
the easiest way to install sharp on windows OS is to use the following npm package
which is called windows-build-tools
npm install --global --production windows-build-tools
this as npm says it downloads
installs Visual C++ Build Tools, provided free of charge by Microsoft. These tools are required to compile popular native modules. It will also install Python 2.7, configuring your machine and npm appropriately.
after this npm install sharp

Encounter `npm ERR! error rolling back Error: ENOTEMPTY` when executing `npm install`

Recently, I study the ReactJS tutorial from a youtube video, link: https://youtu.be/MhkGQAoc7bc?t=2m45s, and I encounter many error when I run npm install in the 1-basic-react directory. In 1-basic-react directory, there is already the file package.json.
Content inside package.json:
{
"name": "react-tutorials",
"version": "0.0.0",
"description": "",
"main": "webpack.config.js",
"dependencies": {
"babel-loader": "^6.2.0",
"babel-plugin-add-module-exports": "^0.1.2",
"babel-plugin-react-html-attrs": "^2.0.0",
"babel-plugin-transform-class-properties": "^6.3.13",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-preset-es2015": "^6.3.13",
"babel-preset-react": "^6.3.13",
"babel-preset-stage-0": "^6.3.13",
"react": "^0.14.6",
"react-dom": "^0.14.6",
"webpack": "^1.12.9",
"webpack-dev-server": "^1.14.1"
},
"devDependencies": {},
"scripts": {
"dev": "./node_modules/.bin/webpack-dev-server --content-base src --inline --hot",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC"
}
Error Messages:
unbuild babel-types#6.10.2
unbuild babel-helper-define-map#6.9.0
npm ERR! error rolling back Error: ENOTEMPTY, rmdir 'E:\Users\User\Documents\GitHub\react-js-tutorials\1-basic-react\nod
e_modules\babel-preset-es2015\node_modules\babel-plugin-transform-es2015-computed-properties\node_modules\babel-helper-d
efine-map\node_modules\babel-helper-function-name\node_modules\babel-traverse\node_modules\babylon\lib\tokenizer'
npm ERR! error rolling back babel-helper-define-map#6.9.0 { [Error: ENOTEMPTY, rmdir 'E:\Users\User\Documents\GitHub\re
act-js-tutorials\1-basic-react\node_modules\babel-preset-es2015\node_modules\babel-plugin-transform-es2015-computed-prop
erties\node_modules\babel-helper-define-map\node_modules\babel-helper-function-name\node_modules\babel-traverse\node_mod
ules\babylon\lib\tokenizer']
npm ERR! error rolling back errno: 53,
npm ERR! error rolling back code: 'ENOTEMPTY',
npm ERR! error rolling back path: 'E:\\Users\\User\\Documents\\GitHub\\react-js-tutorials\\1-basic-react\\node_modules
\\babel-preset-es2015\\node_modules\\babel-plugin-transform-es2015-computed-properties\\node_modules\\babel-helper-defin
e-map\\node_modules\\babel-helper-function-name\\node_modules\\babel-traverse\\node_modules\\babylon\\lib\\tokenizer' }
unbuild babel-template#6.9.0
unbuild babel-traverse#6.10.4
unbuild babel-helper-function-name#6.8.0
unbuild babel-runtime#6.9.2
npm WARN engine unicode-property-value-aliases#1.2.1: wanted: {"node":">=6"} (current: {"node":"v0.10.13","npm":"1.3.2"}
)
npm WARN engine unicode-property-aliases#1.1.0: wanted: {"node":">=6"} (current: {"node":"v0.10.13","npm":"1.3.2"})
npm ERR! Error: OK, write
npm ERR! If you need help, you may report this log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <npm-#googlegroups.com>
npm ERR! System Windows_NT 6.2.9200
npm ERR! command "C:\\Program Files (x86)\\nodejs\\\\node.exe" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\bin\
\npm-cli.js" "install"
npm ERR! cwd E:\Users\User\Documents\GitHub\react-js-tutorials\1-basic-react
npm ERR! node -v v0.10.13
npm ERR! npm -v 1.3.2
npm ERR! code OK
npm ERR! Error: OK, close
npm ERR! If you need help, you may report this log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <npm-#googlegroups.com>
npm ERR! System Windows_NT 6.2.9200
npm ERR! command "C:\\Program Files (x86)\\nodejs\\\\node.exe" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\bin\
\npm-cli.js" "install"
npm ERR! cwd E:\Users\User\Documents\GitHub\react-js-tutorials\1-basic-react
npm ERR! node -v v0.10.13
npm ERR! npm -v 1.3.2
npm ERR! code OK
npm ERR! Error: ENOENT, chmod 'E:\Users\User\Documents\GitHub\react-js-tutorials\1-basic-react\node_modules\babel-preset
-es2015\node_modules\babel-plugin-transform-es2015-object-super\node_modules\babel-runtime\node_modules\core-js\library\
modules\core.regexp.escape.js'
npm ERR! If you need help, you may report this log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <npm-#googlegroups.com>
npm ERR! System Windows_NT 6.2.9200
npm ERR! command "C:\\Program Files (x86)\\nodejs\\\\node.exe" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\bin\
\npm-cli.js" "install"
npm ERR! cwd E:\Users\User\Documents\GitHub\react-js-tutorials\1-basic-react
npm ERR! node -v v0.10.13
npm ERR! npm -v 1.3.2
npm ERR! path E:\Users\User\Documents\GitHub\react-js-tutorials\1-basic-react\node_modules\babel-preset-es2015\node_modu
les\babel-plugin-transform-es2015-object-super\node_modules\babel-runtime\node_modules\core-js\library\modules\core.rege
xp.escape.js
npm ERR! fstream_path E:\Users\User\Documents\GitHub\react-js-tutorials\1-basic-react\node_modules\babel-preset-es2015\n
ode_modules\babel-plugin-transform-es2015-object-super\node_modules\babel-runtime\node_modules\core-js\library\modules\c
ore.regexp.escape.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! fstream_finish_call chmod
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\fstream\lib\writer.js:305:19
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm ERR! tar pack Error reading C:\Users\Casper\AppData\Local\Temp\npm-2516\1466863728585-0.9564304898958653\package
npm ERR! tar pack Error reading C:\Users\Casper\AppData\Local\Temp\npm-2516\1466863728585-0.9564304898958653\package
npm ERR! addLocalDirectory Could not pack "C:\\Users\\Casper\\AppData\\Local\\Temp\\npm-2516\\1466863728585-0.9564304898
958653\\package" to "C:\\Users\\Casper\\AppData\\Roaming\\npm-cache\\babel-messages\\6.8.0\\package.tgz"
npm ERR! addLocalDirectory Could not pack "C:\\Users\\Casper\\AppData\\Local\\Temp\\npm-2516\\1466863728585-0.9564304898
958653\\package" to "C:\\Users\\Casper\\AppData\\Roaming\\npm-cache\\babel-messages\\6.8.0\\package.tgz"
unbuild babel-traverse#6.10.4
unbuild babel-template#6.9.0
unbuild babel-types#6.10.2
npm ERR! error rolling back Error: ENOTEMPTY, rmdir 'E:\Users\User\Documents\GitHub\react-js-tutorials\1-basic-react\nod
e_modules\babel-preset-stage-0\node_modules\babel-preset-stage-1\node_modules\babel-plugin-transform-class-constructor-c
all\node_modules\babel-runtime\node_modules\core-js\modules'
npm ERR! error rolling back babel-plugin-transform-class-constructor-call#6.8.0 { [Error: ENOTEMPTY, rmdir 'E:\Users\Us
er\Documents\GitHub\react-js-tutorials\1-basic-react\node_modules\babel-preset-stage-0\node_modules\babel-preset-stage-1
\node_modules\babel-plugin-transform-class-constructor-call\node_modules\babel-runtime\node_modules\core-js\modules']
npm ERR! error rolling back errno: 53,
npm ERR! error rolling back code: 'ENOTEMPTY',
npm ERR! error rolling back path: 'E:\\Users\\User\\Documents\\GitHub\\react-js-tutorials\\1-basic-react\\node_modules
\\babel-preset-stage-0\\node_modules\\babel-preset-stage-1\\node_modules\\babel-plugin-transform-class-constructor-call\
\node_modules\\babel-runtime\\node_modules\\core-js\\modules' }
unbuild babel-runtime#6.9.2
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! E:\Users\User\Documents\GitHub\react-js-tutorials\1-basic-react\npm-debug.log
npm ERR! not ok code 0
Based on your comment, you've got some kind of PATH problem. At a command line, you can type echo %PATH% and look for multiple entries that point to a node directory.
You'll need to edit your path so that only the directory with the latest copy of node is there. There are instructions for doing this on Windows 7 on other Stack sites.
One thing to be careful about: if you've installed global modules, they are very likely in the v0.10.13 directory tree. Make note of them before you change anything with an npm ls -g --depth=0 as you will likely need to reinstall these global modules once you fix the path issue.