I'm trying to install #tensorflow/tfjs-node#3.2.1 (latest).
I have follow a lot of other questions I saw regarding such problems but haven't found an answer for this specific issue.
I have installed visual studio with the requested build tools.
node 14.15.5
Tried with and without the flag.
This is the output of the install command:
$ npm install #tensorflow/tfjs-node --build-from-source
npm WARN deprecated node-pre-gyp#0.14.0: Please upgrade to #mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the #mapbox scoped package will recieve updates in the future
> #tensorflow/tfjs-node#3.2.0 install C:\Users\dark_\Desktop\projects\tfjs2\node_modules\#tensorflow\tfjs-node
> node scripts/install.js
CPU-windows-3.2.0.zip
* Downloading libtensorflow
* Building TensorFlow Node.js bindings
symlink ./lib/napi-v7 failed: null
npm WARN tfjs2#1.0.0 No description
npm WARN tfjs2#1.0.0 No repository field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! #tensorflow/tfjs-node#3.2.0 install: `node scripts/install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the #tensorflow/tfjs-node#3.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! C:\Users\dark_\AppData\Roaming\npm-cache\_logs\2021-02-27T18_14_41_492Z-debug.log
After spening a day trying the usual suspects (node-gyp reinstall as global, windows building tools (re)install as global, parameter settings, etc) I've debugged the install script and found an error in it: after the symlink stuff, the author didn't check the "error" variable, and went straight to process.exit(1)
After I tore out my hair, I've found that the solution is on it's way:
https://github.com/tensorflow/tfjs/commit/2e745c8b6efe5ffc396a86cfc50347e629091248
It has been commited to the main branch (2021.02.26), so probably we'll see it in v3.3.0, or v3.2.x
Now the problem is, that if you just do a simple npm install #tensorflow\tfjs-node, the installer sees it as an error, and deletes the whole downloaded directory in node_modules. You COULD prevent the whole thing by:
EXECUTING npm install #tensorflow/tfjs-node --ignore-scripts
THEN correcting the error by hand in the install script (check the commit at the above link) and
RUNNING npm rebuild #tensorflow/tfjs-node --build-from-source.
I needed to restart VSCode, because it had difficulties picking up the references. But if you don't want to mess arround, go back to the v2.x branch for the time being.
Related
I try to start a new ionic project. I did those steps
1.npm install -g #ionic/cli
2.ionic start
and I got those errors related to npm. I searched but could not find a solution.
npm WARN deprecated request#2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN registry Unexpected warning for https://registry.npmjs.org/: Miscellaneous Warning EINTEGRITY: sha512-F4TxbIf2Zho1u0gkwk7pMZkuAOcjie2Ifj9Txahek0JAUamP58o+0YUlXp2xApo68CRZSFS4nMA5h897G2Q93A== integrity checksum failed when using sha512: wanted sha512-F4TxbIf2Zho1u0gkwk7pMZkuAOcjie2Ifj9Txahek0JAUamP58o+0YUlXp2xApo68CRZSFS4nMA5h897G2Q93A== but got sha512-T7rpJR5srgZoHOMh8Kv1DDE6mbnW43SNUk9aRhPXGCfF2iJZoTEItjVYHC/gvtncRQCksb8Tk6f72HLaB6la0A==. (50573 bytes)
npm WARN registry Using stale data from https://registry.npmjs.org/ due to a request error during revalidation.
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 ERR! cb() never called!
npm ERR! This is an error with npm itself. Please report this error at:
npm ERR! https://npm.community
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Admin\AppData\Roaming\npm-cache_logs\2020-05-05T06_02_58_568Z-debug.log
[ERROR] An error occurred while running subprocess npm.
Delete package-lock.json file from your project, if it is created.
Check your npm version using
npm -v
If your npm version is 5 and above. Then run the following command:
npm cache verify
Then run your install command
npm install -g #ionic/cli
In case you are having the same issue.
I found a solution for this. Go to your terminal and run
npm cache clean --force or remove npm-cache folder manually from C:\Users\Admin\AppData\Roaming
And then run ionic start again
*npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! github#0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the github#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:*
or sometimes I am different kind of errors just after creating the app. which means no modifications to the default automatic generated project.
and I managed to solved it.
the issue seems to be with my Yarn. incomplete uninstall or something like that. can't solve it by just reinstalling Yarn or uninstall it again. because of that, NPM create-react-app also create bugs, which IDK how.
but the solution is amazing, I just created the project in a different folder. trust me I'm not lying , different location do works in NPM. so I believe I need to format my computer to solve this 100%.
The cause maybe due to I have installed create-react-app via NPM globally and tries to install Yarn create-react-app.
anyway, by using a different folder location, my issue was fixed completely.
Running npm start after npm init does not work due to reported missing react-script library.
It is on my Windows 10 machine; I tried uninstalling and reinstalling node but it did not help.
I can only run my project by typing
>node .\node_modules\react-scripts\bin\react-scripts.js start
otherwise if I run:
>npm start
I can see errors pasted below.
reactapptest#0.1.0 start C:(...)\reactapptest
react-scripts start
npm ERR! file bash
npm ERR! path bash
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn bash
npm ERR! reactapptest#0.1.0 start: react-scripts start
npm ERR! spawn bash ENOENT
npm ERR!
npm ERR! Failed at the reactapptest#0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
It looks like something is wrong with my path but I am not sure and I do not know how to solve it.
The specific error you are getting points out that bash is not available. Now bash is a shell for Unix and Unix-like environments, it is not typically installed on Windows by default. (Though it is available for Windows as well through MinGW.)
You are working on Windows, you should not need bash with react-scripts. Try upgrading npm with npm install -g npm#latest to see if this is caused by an old and broken version of npm on your system.
EDIT: Also, you may have previously configured npm to use bash. See: how to set shell for npm run-scripts in windows and note that you are pretty much trying to do the opposite, so if you have custom configuration you might want to try removing it (also explained in the linked accepted answer).
I'm trying to use JHipster with the DevBox at work, so with a proxy.
I think I have everything configured accordingly, but I still can't use JHipster properly.
I want to generate a microservice gateway with Protractor, but when I use yo jhipster or npm install, it gives me the following error:
> example-gateway#0.0.0 postinstall /home/vagrant/workspace/example/example-gateway
> webdriver-manager update
sh: 1: webdriver-manager: not found
npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents#1.0.12
npm ERR! Linux 3.13.0-88-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! node v4.4.5
npm ERR! npm v3.9.6
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! example-gateway#0.0.0 postinstall: `webdriver-manager update`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the example-gateway#0.0.0 postinstall script 'webdriver-manager update'.
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 example-gateway package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! webdriver-manager update
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs example-gateway
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls example-gateway
npm ERR! There is likely additional logging output above.
And with sudo:
npm WARN lifecycle example-gateway#0.0.0~postinstall: cannot run in wd %s %s (wd=%s) example-gateway#0.0.0 webdriver-manager update /home/vagrant/workspace/example/example-gateway
However, I found webdriver-manager in the node_modules/protractor/bin directory, but npm seems to be unable to use it.
Actually, I already succeeded once in generating a microservice gateway with Protractor, but I don't know how: the error about webdriver-manager just disappeared one day. Indeed, there was several other errors (packages that didn't want to be installed), and running npm install over and over again while sometimes installing manually some packages seemed to fix them. However I'm trying to use JHipster on another computer so I need to know how to fix the webdriver-manager error.
I took a look in the node_modules folder of the completed gateway project, and discovered a webdriver-manager symlink inside .bin that wasn't in the same directory of the incomplete gateway project, so I supposed npm used it instead of the one in the node_modules/protractor/bin directory. I created one linking the two in the node_modules/.bin directory of the incomplete gateway project with ln -s ../protractor/bin/webdriver-manager webdriver-manager, and it apparently worked.
The problem is that I'm trying to make the installation and the configuration of the JHipster DevBox somehow automated, so people at work wanting to use it don't have to do it manually. If they have to remember to create a symlink each time they encounter that error, it won't be very practical.
Do you know why npm won't create that symlink himself (or sometime fails to install some packages), and how to fix it in a "clean" way?
Ok I found a solution, but I still don't know exactly why it does this and if their is a cleaner way to fix it.
http://perrymitchell.net/article/npm-symlinks-through-vagrant-windows/
I just replaced the node_modules directory by a symlink to somewhere inside the guest machine, so not in the shared folder with Windows. That way, I skip all the problems caused by Windows. The downside is I have to create the link before generating any project, and to fix that link and download again all the dependencies each time I update the DevBox, because I need to destroy the DevBox to update it.
I've tried to make sure I'm using the latest version as my ngCordova media plugin isn't working for some reason.
I get this error:
npm WARN locking Error: EACCES, open '/Users/SubjectiveEffect/.npm/_locks/bower-e8debc5417026b57.lock'
npm WARN locking at Error (native)
npm WARN locking /Users/SubjectiveEffect/.npm/_locks/bower-e8debc5417026b57.lock failed { [Error: EACCES, open '/Users/SubjectiveEffect/.npm/_locks/bower-e8debc5417026b57.lock']
npm WARN locking errno: -13,
npm WARN locking code: 'EACCES',
npm WARN locking path: '/Users/SubjectiveEffect/.npm/_locks/bower-e8debc5417026b57.lock' }
npm ERR! Darwin 14.5.0
npm ERR! argv "node" "/usr/local/bin/npm" "install" "-g" "bower"
npm ERR! node v0.12.7
npm ERR! npm v2.11.3
npm ERR! Attempt to unlock /usr/local/lib/node_modules/bower, which hasn't been locked
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR! /Users/SubjectiveEffect/myApp/npm-debug.log
I've no idea how to fix this.
Anyone any ideas?
Edit: I did some tidying up, uninstalled and reinstalled. I'm now getting this error when I try "bower install ngCordova"
"bower cached git://github.com/driftyco/ng-cordova.git#0.1.12-alpha
bower validate 0.1.12-alpha against git://github.com/driftyco/ng-cordova.git#*
bower ECMDERR Failed to execute "git ls-remote --tags --heads git://github.com/driftyco/ng-cordova.git", exit code of #69 Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo.
Additional error details:
Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo."
But if I try to run it with sudo I get told:
"bower ESUDO Cannot be run with sudo
Additional error details:
Since bower is a user command, there is no need to execute it with superuser permissions.
If you're having permission errors when using bower without sudo, please spend a few minutes learning more about how your system should work and make any necessary repairs."
Any ideas?
The error is stating problems accepting Xcode/iOS license agreement which is a dependency of cordova (to get iOS emulation working).
I guess that Xcode has already been installed by npm/bower, you just need to open it for the first time (Cmd-Space, then type Xcode) to accept the license agreement, then rerun bower install ngCordova.
If Xcode is not yet installed, it is probably less of a hassle to install it manually (see here for details), open it once and rerun bower install ngCordova.
BTW, ilj is right, it is usually a bad practice to run npm or bower under sudo. This leads to all sorts of worm cans.
bower complains that you're running it as root, which is usually a bad practice. you need to run it as "bower --allow-root".
I experienced the same issue with Ionic. The reason was that xCode was updated to a newer version, and I hadn't accepted the terms or launched it after the update.
Just open xCode and try again.