Can't walk dependency graph: Cannot find module './crypto_auth' sodium-universal - javascript

I am getting the following error when attempting to browserify a node project (https://github.com/datproject/sdk) and am getting the following error.
Error: Can't walk dependency graph: Cannot find module './crypto_auth' from 'C:\myPath\node_modules\sodium-universal\index.js'
required by C:\myPath\node_modules\sodium-universal\index.js
at C:\myPath\node_modules\resolve\lib\async.js:137:35
at load (C:\myPath\node_modules\resolve\lib\async.js:156:43)
at onex (C:\myPath\node_modules\resolve\lib\async.js:181:17)
at C:\myPath\node_modules\resolve\lib\async.js:15:69
at FSReqCallback.oncomplete (fs.js:158:21)
npm ERR! code ELIFECYCLE
Usually I'd npm install the missing module. However, this doesn't work in this case. Also I can find no mention of crypt_auth anywhere in the project (the referencedindex.js has a single line module.exports = require('sodium-native'))
How do I debug this?

After Paul90's comment here, I solved like this:
cd into the yourPath/node_modules/sodium-universal/build-scripts dir
run node generate.js
go back to the sdk dir and run npm run build

Related

Next.js: Module not found: Can't resolve 'canvg'

I have a next.js project and I keep getting:
error - ./node_modules/jspdf/dist/jspdf.es.min.js:458:25
Module not found: Can't resolve 'canvg'
I'm not sure why because I'm not including either jspdf or canvg.
Not sure what's causing it. Any help would be appreciated. I'm using material-ui if that matters.
It seems dependency error means that particular Module is missing when it's running.
Run npm ls or yarn list will print to stdout all the versions of packages that are installed, as well as their dependencies, in a tree-structure. Then search for that particulate packages are listed or not.
Run npm ls jspdf or yarn list jspdf then you can see its list of dependencies in tree-structure.
Please check your node version is updated or not ? If not then update first.
Quick & Dirty way: delete package.lock or yarn.lock file and delete .node_modules folders And Then run npm install or yarn to install again.
Look at console while you installing and make sure there are no error in the installing process. If you saw error you better look that massages also.

Installing npm packages, after recieving the node modules folder

My name is Jaffer Syed and I am wondering how to install npm packages into my code.
I am trying to install num2fraction https://www.npmjs.com/package/num2fraction but in you npm package video you didnt go into how to install npm packages and how to actually make it work in the javascript. I added the command for the package in the command line but it doesn't seem to work for some reason and when I find the error it keeps saying that the require is not defined.
my js looks like this for trying to implement the num2fraction
var n2f = require('num2fraction')
console.log(n2f(2.555))
thank you
here is a sample script for how I did what you're trying:
mkdir foo
cd foo
npm init
just accept all the default options here
npm install -s num2fraction
put your exact contents above into a file called foo.js in this directory and save
node foo.js
should output 511/200

Error: Cannot find module 'loopback' in nodejs

I am facing below issue and unable to figure out the root cause.
Error: Cannot find module 'loopback'
Below are the dependencies I have in my package.json
"loopback": "^3.19.0",
"loopback-boot": "^2.6.5",
"loopback-component-explorer": "^6.0.0",
"loopback-connector-postgresql": "^2.9.0"
First I did npm i and then node .
But it throws an error Cannot find module 'loopback'
Don't understand why this is behaving differently. Please suggest
Edit: My all modules are found under
> node_modules
> .staging
> //loopback modules and other modules are placed under .staging but not sure why.
The fact that your dependencies are inside the staging directory and not the main node_modules directory imply that something went wrong with the download/installation process and your dependencies are not installed properly. And hence you get the 'Could not find module' error.
Try the following steps -
Delete package-lock.json
Delete Node Modules folder
Do a npm install to install packages listed in package.json
Once the installation is complete, all your node dependencies should be inside your node_modules folder.
It might also be worth checking to see if you have more than one node version on your machine. That could cause similar problems as well.
use
npm config set user 0
npm config set unsafe-perm true
npm install -g loopback-cli
npm install
https://loopback.io/doc/en/lb3/

What is Quint? I cloned a repo that mimics real raindrops on a glass wall. I tried to run it but gives me an error `Quint is not defined`

I cloned a repo RainEffect that mimics real raindrops on a glass wall. I tried to run it but gives me an error Quint is not defined . I installed all the node modules it contained. Also tried yarn build npm start to initiate the application. Then I traced the error below:
function setupParallax(){
document.addEventListener('mousemove',(event)=>{
let x=event.pageX;
let y=event.pageY;
TweenLite.to(parallax,1,{
x:((x/canvas.width)*2)-1,
y:((y/canvas.height)*2)-1,
ease:Quint.easeOut,
onUpdate:()=>{
renderer.parallaxX=parallax.x;
renderer.parallaxY=parallax.y;
}
})
});
}
The error says: Quint is not defined So I tried install npm install --save Quint and says:
npm ERR! code E404
npm ERR! 404 Not Found: Quint#latest
Please Help - Thanks in advance!
https://greensock.com/docs/Easing/Quint
you can add GSAP using NPM
npm install gsap
More information about the package can be found below
https://www.npmjs.com/package/gsap

All NPM COMMAND not working even I updated .bash_profile

I used npm for several months.
But after I install python/django and virtual environment, it's not working anymore.
The error is smething like this.
sudo npm install -g react-native-cli
module.js:341
throw err;
^Error: Cannot find module './cache/caching-client.js'
I used npm for several days but this happened first time. I searched to solve issue and found this link
Installing MEAN Stack: npm -v module.js: 338 throw err; Error: Cannot find module './cache/caching-client.js'.
But not working.
echo $NODE_PATH
/usr/local/lib/node_modules
And it occurs on all npm commands.
npm -v
npm init -y
I reinstalled the node.js again and it worked.:)
f you added React Native manually to your project, make sure you have included all the relevant dependencies that you are using, like RCTText.xcodeproj, RCTImage.xcodeproj. Next, the binaries built by these dependencies have to be linked to your app binary. Use the Linked Frameworks and Binaries section in the Xcode project settings. More detailed steps are here: Linking Libraries.
If you are using CocoaPods, verify that you have added React along with the subspecs to the Podfile. For example, if you were using the , and fetch() APIs, you would need to add these in your Podfile:
for more see this
https://www.npmjs.com/package/react-native-winjs-cli/tutorial

Categories

Resources