package.json

Is there a way to extract package.json from package-lock.json?

允我心安 提交于 2019-12-25 03:13:24
问题 I'm working on a project in which the package.json file is missing. The developer has pushed the package-lock.json file without the package.json file. How can I create a clean package.json from the package-lock.json file in case it is at all possible? 回答1: It's not possible to generate full package.json from package-lock.json because the latter doesn't contain all necessary data. It contains only a list of dependencies with specific versions without original semvers. Production and

Should I manually update dependencies versions in the package.json after creating a new project with npm?

邮差的信 提交于 2019-12-24 21:47:21
问题 I've installed this boilerplate with Electron and Vuetify frameworks included: https://github.com/vuetifyjs/electron Questions: Should I now manually change those versions in the package.json to the latest and run npm install again? "dependencies": { "vue": "^2.4.2", "vuetify": "0.17.4", "vue-electron": "^1.0.6", [...] }, "devDependencies": { "electron": "^1.7.5", [...] } Why do those dependencies have that ^ symbol if they still don't download the latest version? The boilerplate has this

npm - package.json override main field

ぃ、小莉子 提交于 2019-12-24 18:09:57
问题 I use some npm packages in my project. Two of them have the wrong main -field. Is it possible to override them? I use webpack. I found a solution here. This works for the main field but I also need a css-file from the same package. I refer it with ~package/css/style.css in my index.scss file. With the solution above it resolves the path with path/to/main.js/css/style.css (with main.js) instead of path/to/css/style.css (without main.js). I could refer it directly ../node_modules/path/to/css

npm outdated does not respect caret notation of package.json

烈酒焚心 提交于 2019-12-24 16:13:49
问题 Using a package.json file with the following "devDependencies": { "grunt": "^0.4.5", "grunt-concurrent": "^1.0.0", "grunt-contrib-jshint": "^0.10.0", "grunt-contrib-watch": "^0.6.1", "grunt-dev-update": "^1.1.0", "grunt-jasmine-node-new": "^0.3.2", "grunt-node-inspector": "^0.1.5", "grunt-nodemon": "^0.4.0", "grunt-npm-install": "^0.1.0" } I get an npm outdated output that looks like Why is Wanted not 0.11.0? Doesn't "grunt-contrib-jshint": "^0.10.0" mean any version greater than or equal to

Force npm download from private registry

老子叫甜甜 提交于 2019-12-24 10:25:36
问题 In my nodejs project I had to modify 4 of the node modules and upload them to our private corporate registry so the project will download the modified versions during builds. I did this by changing the resolved field in package-lock.json for each dependency from our virtual npm registry which forwards downloads to the public npm registry to our private registry. This is working for 3 out of the 4 modules, however 1 module, phantomjs-prebuilt , will not download the one I uploaded. When I view

How to use react-router BrowserRouter in a static index.html file

╄→гoц情女王★ 提交于 2019-12-24 00:33:48
问题 I'm attempting to use the static index.html file generated by npm run build, along with react-router. the tl;dr is; i do not want a client server, I want the app to be loaded by opening the index.html file located in the build folder and still have BrowserRouter be able to route between components. At the moment, the page will load the 'home' component if I exclude the 'exact' prop in the route path, meaning it knows that it's out there somewhere, I just don't know how to configure the router

How do I deploy the package.json version id to AppEngine flexible environment --version argument?

陌路散爱 提交于 2019-12-23 22:23:56
问题 AppEngine Flexible Environment deploys using gcloud app deploy are generally slow because AppEngine has to spin up the container environment before deploying the code and switching traffic to it. A common method to speed up the deployment is to specify the version, that way AppEngine deploys new code to the same container environment. Such as: gcloud app deploy --version=12345 In a node environment, I would like to use the package.json version in my deploy scripts, for example: { "name":

Firebase function Cannot find module 'cycle'

徘徊边缘 提交于 2019-12-23 10:57:49
问题 When I try to run any firebase command I get this error. internal/modules/cjs/loader.js:596 throw err; ^ Error: Cannot find module 'cycle' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:594:15) at Function.Module._load (internal/modules/cjs/loader.js:520:25) at Module.require (internal/modules/cjs/loader.js:650:17) at require (internal/modules/cjs/helpers.js:20:18) at Object.<anonymous> (/usr/local/lib/node_modules/firebase- tools/node_modules/winston/lib/winston/common

Firebase function Cannot find module 'cycle'

笑着哭i 提交于 2019-12-23 10:57:01
问题 When I try to run any firebase command I get this error. internal/modules/cjs/loader.js:596 throw err; ^ Error: Cannot find module 'cycle' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:594:15) at Function.Module._load (internal/modules/cjs/loader.js:520:25) at Module.require (internal/modules/cjs/loader.js:650:17) at require (internal/modules/cjs/helpers.js:20:18) at Object.<anonymous> (/usr/local/lib/node_modules/firebase- tools/node_modules/winston/lib/winston/common

Rename file with NPM

故事扮演 提交于 2019-12-23 09:34:35
问题 Is there a way to rename a single file in npm scripts? I want to prepare files for distribution, but I need the built files to be named differently than they are in the source... I have tried orn, but that only seems to work on the command line, not as an npm script. I'm specifically looking to just add a cross-platform dependency to do my project, rather than writing my own javascript script to copy files over. My ideal solution is something I can include in the package.json , as a one line