npm install legacy React with semantic-ui and Gulp - node.js

I am trying to install a React legacy project, but I have an error. The project is using semantic-ui 2.2.13, that is the library that seems to have the problem.
When I do npm install --legacy-peer-deps, this message appears:
npm ERR! code 1
npm ERR! path c:\src\project\node_modules\semantic-ui
npm ERR! command failed
npm ERR! command c:\WINDOWS\system32\cmd.exe /d /s /c gulp installfs.js:47
npm ERR! } = primordials;
....
npm ERR! ReferenceError: primordials is not defined
npm ERR! at fs.js:47:5
...
In the detailed log this message apperas
verbose pkgid semantic-ui#2.4.2 (instead of version 2.2.13)
I have node v16.6.1, npm 7.20.3 and in package.json react ^16.13.0, webpack ^4.23.1 among others
Could you please bring me some light about this?

In summary, your are getting the error because semantic-ui uses Gulp 4, which is not compatible with Node 12 and above. This answer suggests overriding the sub-dependency causing the error.
You may follow the issue in the official semantic-ui repo here
This article also details how to resolve this error.

Related

Hyperleger Indy - TheOrgBook Module Build Failure due to Node and NPM Issue

I have deployed VON Network and Permitify Modules of Hyperledger Indy SSI VC Demo in MacOS successfully. I am facing issues in TheOrgBook setup. However TheOrgBook Demo is failing even after trying the hot fix suggested in the GitHub Issue #26.
ERROR in ./src/main.ts
Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' in '/opt/app-root/src/src'
ERROR in Error: Error encountered resolving symbol values statically. Could not resolve localize-router relative to /opt/app-root/src/src/app/app.module.ts., resolving symbol AppModule in /opt/app-root/src/src/app/app.module.ts, resolving symbol AppModule in /opt/app-root/src/src/app/app.module.ts, resolving symbol AppModule in /opt/app-root/src/src/app/app.module.ts
npm ERR! code ELIFECYCLE
npm ERR! Failed at the tob-web#0.0.1 postinstall script 'ng build --prod --base-href ${NG_BASE_HREF:-/} ${NG_BUILD_FLAGS:-} && cp dist/themes/_active/index.html dist/index.html'.
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 tob-web package,
npm ERR! not with npm itself.
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs tob-web
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls tob-web
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /opt/app-root/src/npm-debug.log
Build failed
Wrong example, try this one link

error in custom yeoman generator "You don't seem to have a generator with the name scotchmeans installed."

I created custom yeoman generator following below link.
https://scotch.io/tutorials/create-a-custom-yeoman-generator-in-4-easy-steps
i've done all the required steps when i use npm link in the node command prompt, i got below error
C:\Users\welcome\Desktop\bhargav\generator-scotchmeans>npm link
npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "link"
npm ERR! node v5.9.0
npm ERR! npm v3.7.3
npm ERR! Package must have a name field to be linked
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! C:\Users\welcome\Desktop\bhargav\generator-scotchmeans\npm-debug.log
and when i do "yo scotchmeans" i got below error
C:\Users\welcome\Desktop\bhargav\generator-scotchmeans>yo scotchmeans
Error scotchmeans
You don't seem to have a generator with the name scotchmeans installed.
You can see available generators with npm search yeoman-generator and then install them with npm install [name].
To see the 2 registered generators run yo with the --help option.
can anyone please give suggestion how to resolve
A little late, maybe, but I encountered this error as well. In my case, the command
npm link
did not do what I thought it would do. Instead, I had to specify the package name explicitly:
npm link generator-mygenerator
Afterwards, I was successfully able to call the generator:
yo mygenerator

‘node-gyp rebuild’ installation error when adding a package to meteor app in Windows 7

I was trying to add a package (mizzao:turkserver) to my Meteor application, but I kept getting this error:
mizzao:turkserver: updating npm dependencies -- request, libxmljs,
validator, querystring, async, deepmerge...
gypnpm ERR! Windows_NT 6.1.7601
npm ERR! argv
"C:\\Users\\PC4all\\AppData\\Local\\.meteor\\packages\\meteor-tool\\1.1.3\\mt-os
.windows.x86_32\\dev_bundle\\bin\\\\node.exe"
"C:\\Users\\PC4all\\AppData\\Local\\.meteor\\packages\\meteor-tool\\1.1.3\\mt-os
.windows.x86_32\\dev_bundle\\bin\\node_modules\\npm\\bin\\npm-cli.js"
"install" "libxmljs#0.8.1"
npm ERR! node v0.10.36
npm ERR! npm v2.7.3
npm ERR! code ELIFECYCLE
npm ERR! libxmljs#0.8.1 install: `node-gyp rebuild`
npm ERR! Exit status 7
npm ERR!
npm ERR! Failed at the libxmljs#0.8.1 install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the libxmljs package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls libxmljs
npm ERR! There is likely additional logging output above.
=> Babel active on file extensions: es6.js, es6, jsx
=> Errors while adding packages:
While building package mizzao:turkserver:
error: couldn't install npm package
I am developing my Meteor application on a Windows 7 machine and from what I have been able to gather from posts on forums, the error seems to be related to that fact (interaction between npm and Windows - I did not find any posts describing the same problem on Linux machines).
I've already tried installing the latest Python version and MS Visual Studio 2013 as suggested here: https://github.com/TooTallNate/node-gyp#installation, as well as setting some environment variables as suggested here: https://github.com/atom/atom/issues/2754. But none of those helped.
Any help would be greatly appreciated!
As I described in this comment, this seems to be an issue with the Python path being set incorrectly for npm, as Meteor's distribution of npm isn't hooking it up correctly. Most Linux distros come with Python, but Windows doesn't, so it is correlated with running Windows.
It can be fixed by making sure that Python is installed, then running the following command:
npm config set python C:\Python27\python.exe
The use of an old libxmljs is because mizzao:turkserver is dependent on a relatively old node MTurk API, which I'd like to wean it off of at some point, but isn't such a high priority at the moment.
See also:
https://github.com/lovell/sharp/issues/163
https://www.robertkehoe.com/2015/03/fix-node-gyp-rebuild-error-on-windows/

Installing material-design-lite with NPM

I'm working on a MEAN stack (Mongo, Express, Angular, Node) and would like to use Google's Material Design Lite library. According to the docs one should run
npm install material-design-lite --save
Inside an NPM project to enable use of the mdl components. I get following error:
npm ERR! Failed at the material-design-lite#1.0.0 install script 'napa mojombo/clippy'.
npm ERR! This is most likely a problem with the material-design-lite package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! napa mojombo/clippy`
So there's a problem with napa mojombo/clippy anyone have an idea how to fix this?
try to find the root cause with verbose
npm install material-design-lite --save --verbose
npm install material-design-lite#1.0.0-3
this should work, issue here

Can't run npm install in an Ember CLI application?

I am setting up an Ember application on a new laptop. I installed node, npm through brew and I also have the Ember CLI. Within the Ember CLI app, I'm trying to do an npm install but when I do, I get this error in the terminal:
npm WARN package.json npm#1.4.21 Non-dependency in bundleDependencies: inherits
npm ERR! Darwin 14.0.0
npm ERR! argv "node" "/usr/local/bin/npm" "install"
npm ERR! node v0.10.33
npm ERR! npm v2.1.11
npm ERR! code E404
npm ERR! 404 Not Found: expresss
npm ERR! 404
npm ERR! 404 'expresss' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404 It was specified as a dependency of 'ember-cli'
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/Nagarjun/Code/sumo-list/web-client/npm-debug.log
I can't run my projects until this is resolved. What am I missing? I even Googled but couldn't find anything for expresss.
My guess is 'expresss' (with an extra s) is a package on npm that was pulled. The dependency was in fact listed in the package.json file for ember-cli but I don't think anyone ever noticed it until later versions.
Proof: https://github.com/stefanpenner/ember-cli/blob/ec8a6ab898599746bddbb8f72f7633c29f0ee95b/package.json#L58
I was able to resolve this issue by uninstalling node and npm completely using brew. Then, installing node.js using the package from nodejs.org. Now, my npm version is 1.4.28. Looks like the issue was caused by the newer npm 2.1.10. Not sure why brew automatically picks up the new npm.
Look in your package.json dependencies section. Looks like a typo.
I faced the same issue but it got fixed by running sudo npm install -g ember-cli

Resources