Cannot find module 'unicode/category/So' - node.js

When i am trying to run this command - yo mobileangularui, its showing this error. I have read many solutions on the internet but none of them removed this error. Can anyone help?
module.js:341
throw err;
^
Error: Cannot find module 'unicode/category/So'
at Function.Module._resolveFilename (module.js:339:15)
at Function.Module._load (module.js:290:25)
at Module.require (module.js:367:17)
at require (internal/module.js:20:19)
at symbols (/usr/lib/node_modules/generator-mobileangularui/node_modules/slug/slug.js:6:16)
at /usr/lib/node_modules/generator-mobileangularui/node_modules/slug/slug.js:123:5
at Object.<anonymous> (/usr/lib/node_modules/generator-mobileangularui/node_modules/slug/slug.js:130:2)

There is, sometimes, an issue with npm and executing post install script. Try this steps :
cd /path/to/your/project/node_modules/unicode
check emptiness category directory with ls command
execute this command npm test
If the test is ok, you can continue your work. If it doesn't work check this issue on GitHub.
Hope it help and sorry for my English.

If you are facing this issue and you are behind windows please follow below steps, I hope worked for you :
Remove the unicode module using npm, npm remove unicode
Download the file from
http://unicode.org/Public/UNIDATA/UnicodeData.txt and placed it into
C:\usr\share\unicode-data\ if your project is in C drive, or if you are in
linux /usr/share/unicode or /usr/share/unicode-data
Install unicode again

There is a pending PR which will resolve this - https://github.com/dodo/node-unicodetable/pull/22

Related

npm start not working for react after changing partition directories in windows

i recently changed my hard drive partitions and merged them into one partition
now when i am trying to starting react from npm start its giving some error so i have uninstalled and reinstalled node js multiple times like 4 times but nothing worked ,
i have created a new react-redux project with npx create-react-app react-redux
here is my command line responses
PS D:\games&software\software\installed\web-development-folder\www\02\react\react-redux> npm start
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
> react-redux#0.1.0 start
> react-scripts start
'software\software\installed\web-development-folder\www\02\react\react-redux\node_modules\.bin\' is not recognized as an internal or external command,
operable program or batch file.
node:internal/modules/cjs/loader:936
throw err;
^
Error: Cannot find module 'D:\react-scripts\bin\react-scripts.js'
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
at node:internal/main/run_main_module:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
PS D:\games&software\software\installed\web-development-folder\www\02\react\react-redux>
one strange thing i have noticed is it is checking for modules in 'D:\react-scripts\bin\react-scripts.js'
but my project directory is D:\games&software\software\installed\web-development-folder\www\02\react\react-redux i feel like this is the main culprit but not sure , after doing too much research i have came for help so please if anyone know what can i do to solve this help me please .
you can try npm i to reinstall all the node_modules that you use. One option could be that they weren't installed properly.
this is totally unexpected error that the & sign was interferring with the url parsing as soon as i have moved my project out of that directory it worked
you can see in the error it was starting the url from 'software\software\installed\web-development-folder\www\02\react\react-redux\node_modules.bin'
but the root folder name is games&software
thanks for other answers and i have posted this if someone come to this situation it might help

''adonis' is not recognized as an internal or external command' problem even though I installed the CLI globally

My Windows 10 PC forces me to install CLI and assign environment varriables (happens when I install ionic). This time, same trouble with Adonis. First, the problem is 'adonis' is not recognized as an internal or external command'
To solve this, I have installed Adonis locally in C:\Users\mq003\AppData\Local\node_modules. Which I receive is the only #Adonis directory and it doesn't come with a .cmd file so I can't use this. Therefore, I imported directly the cli from github with npm i -save #adonisjs/cli and copy the .cmd files in npm directory, while others will be put in node_modules (because my Path declare I put the cmd there).
As you can see, all ngrok, ionic, etc. commands belong here. They all work perfectly fine in every terminals.
When I try to type adonis commands, this time, it said.
PS D:\adonis project> adonis --help
internal/modules/cjs/loader.js:626
throw err;
^
Error: Cannot find module 'C:\Users\mq003\AppData\Roaming\#adonisjs\cli\index.js'
?[90m at Function.Module._resolveFilename (internal/modules/cjs/loader.js:623:15)?[39m
?[90m at Function.Module._load (internal/modules/cjs/loader.js:527:27)?[39m
?[90m at Function.Module.runMain (internal/modules/cjs/loader.js:837:10)?[39m
?[90m at internal/main/run_main_module.js:17:11?[39m {
code: ?[32m'MODULE_NOT_FOUND'?[39m,
requireStack: []
}
I think it requires #adonisjs directory outside, not in node_modules. So I get that directory out (as you can see in the picture). However, the error still exists.
Editted: I found an issue posted on Github seems relevant to my problem. I will link here in case it helps.
Github

Using nodejs bindings to run native c++ code produces an error

I'm trying to develop an electron app, and I would like to use an npm package that gives vibrancy to a window. This is the package I'm trying to use: https://github.com/sebascontre/windows10-fluently-vibrancy
It uses a visual c++ code to call native windows methods to achieve this vibrancy effect.
I've cloned and I've run the npm install and build as described in the readme and ran the following:
npm install
npm run conf
npm run rebuild
All built successfully and I also see the build\debug artifacts of the c++ build.
When I try to run it (as described in readme):
cd spec\app
electron .
I'm getting the following error message:
Uncaught Exception:
Error: The specified module could not be found.
\\?\F:\Development\windows10-fluently-vibrancy\build\Debug\Vibrancy.node
at process.func [as dlopen] (electron/js2c/asar.js:155:31)
at Object.Module._extensions..node (internal/modules/cjs/loader.js:857:18)
at Object.func [as .node] (electron/js2c/asar.js:155:31)
at Module.load (internal/modules/cjs/loader.js:677:32)
at tryModuleLoad (internal/modules/cjs/loader.js:609:12)
at Function.Module._load (internal/modules/cjs/loader.js:601:3)
at Module.require (internal/modules/cjs/loader.js:715:19)
at require (internal/modules/cjs/helpers.js:14:16)
at bindings (F:\Development\windows10-fluently-vibrancy\node_modules\bindings\bindings.js:112:48)
at Object.<anonymous> (F:\Development\windows10-fluently-vibrancy\index.js:1:35)
According to the message it cannot find the Vibrancy.node file - But I've verified that it exists in the specified location.
Any ideas how to make it run? I have cloned the package to test it since when trying to use the npm itself in my project it gave the same error so I figured I would try the source.
Today I had the exact same issue you're describing here.
I got it to work using electron-rebuild.
From the root of your project run the command: electron-rebuild
Hope this helps you, if not, maybe someone else.

Can't run node module geojson-polygon-labels on Windows

I've download the package from "https://github.com/andrewharvey/geojson-polygon-labels/", ran "npm-install" and the node-modules folder was successfully created:
folder - screenshot
However, when cd to bin folder and run "geojson-polygon-labels < v.geojson > v_label.geojson", it throws the eror: "not recognized as internal or external command, operable program or batch file".
I'm really confused at this point. On github it's not really well-documented how to use this tool, and I'm quite new to Node too.
Please help me. Thanks!
Edit: I've tried install it on Ubuntu (subsystem on Windows 10) then run "geojson-polygon-labels" from the bin folder. The same error occured.
Edit2: I figured out to how properly run the tool. On Ubuntu I ran:
./geojson-polygon-labels < polygon.geojson > labels.geojson
However, now a new error pops out:
/home/lamnguyen/geojson-polygon-labels-master/bin/geojson-polygon-labels:25
turf.featureEach(flatInputGeoJSON, (feature) => {
^
SyntaxError: Unexpected token >
at Module._compile (module.js:439:25)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:902:3
What should I do now?
Edit 4: A friend of mine ran it on a "real" Ubuntu with a small sample file and it worked out. Maybe tomorrow I've give a shot :)
In this package I've set up the bin property in the package.json https://docs.npmjs.com/files/package.json#bin so when you run npm install it knows what scripts are executables. You might need to set up your PATH in your shell to the directory NPM installs the binaries to. Or use the full or relative path as you've found out.
The Unexpected Token > message seems like you're running an older version of node which doesn't support ES6 arrow functions, so try upgrading your version of node?

socket.io: What's the correct way to install it?

I've been able to get npm installed but there are a lot of things that don't seem to work.
My first question is what is going on here:
steven#steven-VirtualBox:~/Documents/node$ sudo npm install socket.io
node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: No such module
at Object.<anonymous> (/usr/share/npm/lib/utils/output.js:8:21)
at Module._compile (module.js:432:26)
at Object..js (module.js:450:10)
at Module.load (module.js:351:31)
at Function._load (module.js:310:12)
at Module.require (module.js:357:17)
at require (module.js:368:17)
at Object.<anonymous> (/usr/share/npm/lib/utils/log.js:21:14)
at Module._compile (module.js:432:26)
at Object..js (module.js:450:10)
I seem to end up here a lot (line 201).
This command works when I don't use sudo. But I don't know if it does what it should do.
Is npm written in javascript? Is there a way I can set it up manually?
Also, I seem to be getting different results running the curl http://npmjs.org/install.sh | sh command to install npm depending on what directory I am in. What directory should I be in when I run it? It's rather frustrating that I don't really know what these scripts are doing behind the scenes.
I find tons of tutorials. They all point back to the same instructions. I follow the instructions. They don't work.... Look for more tutorials.....
I got node.js to compile from src perfectly fine. Ran the benchmarks from there too. That should have been the hardest part!
Do you have an old npm? Deleting the one in usr/bin fixed this problem for me:
$ rm /usr/bin/npm
This is really weird.
Registry down ? DNS issue ?
Try to access this url: http://registry.npmjs.org/-/short
You may want to read the excellent faq here : http://npmjs.org/doc/faq.html
Can you install any other package ?
You also need node version > 0.4 to run npm.

Resources