I am trying to build an Electron project that uses the walkdir library installed via npm. I have electron forge setup, but after trying to open up the zip file in the out folder, I get a message saying: Uncaught Exception: Error: Cannot find module 'walkdir'. How can I declare external libraries with electron-forge? Do I need to add a declaration to the package.json?
I just had to npm install the packages again from inside my src directory and ensure that they were in my package.json as dependencies
Related
In a project which I work with there is private project library which is available for me directly - https://gitlab.some-project/some-utils
In package.json it is requested like
"dependencies": {
"#some-project/some-utils": "0.1.42",
...
}
This project wasn't uploaded to npm. I created .npmrc file and put there:
#8some-project:registry=https://gitlab.some-project.com/some-utils
But when I try to "run yarn #some-project/some-utils" I get:
error Received malformed response from registry for "#some-project/some-utils". The registry may be down.
What I am doing wrongly? How to install this library to another project?
I just raised npm version and it works now
I have just started using yarn and I can't figure out how to link a globally installed package to a project. With npm I would just run npm link <package-name> but it doesn't work with yarn.
when I run yarn link <package-name> it gives this error:
yarn link v1.22.4
error No registered package found called "express".
info Visit https://yarnpkg.com/en/docs/cli/link for documentation about this command.
The link functionality is not really meant for linking global packages to a project. It is meant to link a package that you are working on to another project that you are working on. The fact, that the npm link command can be used to link globally installed packages to the current project is just an implementation detail of npm. From the yarn docs:
For the vast majority of packages it is considered a bad practice to have global dependencies because they are implicit. It is much better to add all of your dependencies locally so that they are explicit and anyone else using your project gets the same set of dependencies.
So you should just add the dependencies via yarn add <package-name>.
I have a react native project that already requires and has installed redux-actions.
The app was working correctly.
I then added yarn add lodash
Afterwards I get an error
Error: ENOENT: no such file or directory, open 'node_modules/redux-actions/node_modules/lodash/identity.js'
Did yarn add remove the lodash somehow from redux-actions/node_modules?
How do I correct this error?
Now that I did an npm list I see that there is a lodash 3.10.1 installed and that redux-actions requires lodash#4.17.4. Did yarn install that lodash based on a requirement of another module and hoiseted it into the root of node_modules? How do I know which module caused that - I'd like to upgrade it to the latest lodash and want to make sure that doesn't break any dependencies.
I have an AURELIA application that uses the node module 'crypto'.
It works fine with GULP/JSPM (after 'npm install crypto' and 'jspm install crypto').
Now I want to use aurelia-cli instead of JSPM.
But I didn't succeed to load 'crypto' with the Aurelia-cli.
When building the app with 'au build' I got the error:
Error: ENOENT: no such file or directory, open '......\src\crypto.js'
I certainly need to reference 'crypto' in aurelia.json file but I don't find what to insert in this file.
Thanks if somebody could provide aurelia.json content for using crypto.
I am trying to add the mapbox gl package to my Aurealia Typescript skeleton using jspm. I am using the following command.
jspm install npm:mapbox-gl
This is what I am getting.
Looking up npm:mapbox-gl
Updating registry cache...
Downloading npm:mapbox-gl#0.19.1
warn Error on processPackageConfig
Package.json dependency mapbox-gl-shaders set to github:mapbox/mapbox-gl-shaders#e4737bb136d718f9c5fe8d943380f05db6249b57, which is not a valid dependency format for npm.
It's advisable to publish jspm-style packages to GitHub or another registry so conventions are clear.
warn Error processing package config for npm:mapbox-gl.
err Error processing package config for npm:mapbox-gl.
warn Installation changes not saved.
I am using jspm 0.16.36.
When I try to install the package via npm install mapbox-gl it works normally. Any suggestions?
Considering you are using jspm, you might also want to try and reference it through the GitHub repo rather than through npm:
$ jspm install github:mapbox/mapbox-gl-js
It works for me with jspm v16.x and v0.21.0 of MapboxGL.