package-lock.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

Why did package-lock.json change the integrity hash from sha1 to sha512?

痴心易碎 提交于 2019-12-20 15:36:56
问题 I just generated a new npm lockfile, package-lock.json, as part of my typical workflow. But I noticed that this time all of the integrity hashes have been changed from sha1 to sha512. What is happening here? 回答1: From what I can see, npm changed the integrity checksum from sha1 to sha512. If your git changes are going from sha1 to sha512, you should do that update once and it will be good after that. If someone else working with the codebase and sees a git change from sha512 down to sha1

Create package.json from package-lock.json

自闭症网瘾萝莉.ら 提交于 2019-12-05 12:20:27
问题 I downloaded a theme and it has a package-lock.json file but no package.json file. Is there a way I can generate the package.json from the package-lock.json file. How do I install the node modules with just the package-lock.json file. Is there a way to do that? 回答1: Install the latest npm with npm install -g npm Run npm init and respond to the questions. The above command will generate a package.json and include the existing packages listed in package-lock.json 回答2: package-lock.json file

What is the point of putting npm's “package-lock.json” under version control?

我的梦境 提交于 2019-12-04 15:37:34
问题 What is the point of putting npm's package-lock.json under version control? In my experience having this file source controlled has caused more trouble and confusion than efficiency gains. Having package-lock.json under source control makes for a major headache every time a developer who added/removed/modified any node modules needs to resolve conflicts between branches. Especially working on a complex/large apps where the package-lock.json can be tens of thousands of lines long. Even just

Deleting `package-lock.json` to Resolve Conflicts quickly

馋奶兔 提交于 2019-12-04 08:20:54
问题 In a team set up, usually, I have faced merge conflicts in package-lock.json and my quick fix has always been to delete the file and regenerate it with npm install . I have not seriously thought about the implication of this fix because it has not caused any perceivable problem before. Is there a problem with deleting the file and having npm recreate it that way instead of resolving the conflicts manually? 回答1: Yes, it can and will affect all the project in really bad way. if your team does

Create package.json from package-lock.json

故事扮演 提交于 2019-12-03 22:23:37
I downloaded a theme and it has a package-lock.json file but no package.json file. Is there a way I can generate the package.json from the package-lock.json file. How do I install the node modules with just the package-lock.json file. Is there a way to do that? VeeeneX Install the latest npm with npm install -g npm Run npm init and respond to the questions. The above command will generate a package.json and include the existing packages listed in package-lock.json package-lock.json file relies on the presence of a package.json file, So it's not possible to retrieve package.json (happy to be

npm5 equivalent to yarn's --pure-lockfile flag?

China☆狼群 提交于 2019-12-03 11:38:09
问题 I'm looking for an equivalent for yarn's --pure-lockfile flag. This flag is useful when installing dependencies in CI, when you want it to read your lockfile but not modify it. Does npm v5 have an equivalent? 回答1: npm 5.7 introduced the npm ci subcommand: the main differences between using npm install and npm ci are: The project must have an existing package-lock.json or npm-shrinkwrap.json . If dependencies in the package lock do not match those in package.json , npm ci will exit with an

npm install not creating a new package-lock.json

痞子三分冷 提交于 2019-12-03 10:30:21
问题 I accidentally deleted my package-lock.json file. npm install is not generating a new one. How do I get npm to recreate this file. 回答1: The package-lock.json file was introduced in npm v5, so the steps you need to take to regenerate package-lock.json depend on which version of npm you're using. FYI. Let's verify what version of node and npm. npm -v prints: x.x.x node -v prints: x.x.x I believe for package-lock.json is auto-generated if the 2 conditions npm version > 5.x.x and node version > 7

Github potential security vulnerability error for hoek node module

▼魔方 西西 提交于 2019-12-03 05:49:31
问题 Today github is showing following error on my github repository: We found a potential security vulnerability in one of your dependencies. A dependency defined in ./package-lock.json has known security vulnerabilities and should be updated. On clicking on Review vulnerable dependency button following message was displayed: hoek node module before 5.0.3 suffers from a Modification of Assumed-Immutable Data (MAID) vulnerability via 'merge' Till yesterday it was not showing such error. I have not

Why did package-lock.json change the integrity hash from sha1 to sha512?

£可爱£侵袭症+ 提交于 2019-12-03 04:07:59
I just generated a new npm lockfile, package-lock.json, as part of my typical workflow. But I noticed that this time all of the integrity hashes have been changed from sha1 to sha512. What is happening here? Dave From what I can see, npm changed the integrity checksum from sha1 to sha512. If your git changes are going from sha1 to sha512, you should do that update once and it will be good after that. If someone else working with the codebase and sees a git change from sha512 down to sha1 (which is the issue I was having) you can fix it by running the following: Discard the changes in git for