Tag Archives: Npm

[Solved] ERROR Failed to compile with 3 errors These dependencies were not found: * pdfjs-dist/es5/buil

introduction

Xiao Fang is a junior student. Today, he joined a front-end intern position in a company. He is so proud that he plans to do a big job. Results the card was stuck in NPM run build , and the error message was reported (as follows).

$ npm run build

> [email protected] build /usr/local/docker/gitlab-ee-12.4.1/builds/63s9Rzjq/0/dev_web/system
> vue-cli-service build --mode production


-  Building for production...
 ERROR  Failed to compile with 3 errors PM 3:24:46

These dependencies were not found:

* pdfjs-dist/es5/build/pdf.js in ./node_modules/[email protected]@cache-loader/dist/cjs.js??ref--12-0!./node_modules/[email protected]@thread-loader/dist/cjs.js!./node_modules/[email protected]@babel-loader/lib!./node_modules/[email protected]@cache-loader/dist/cjs.js??ref--0-0!./node_modules/[email protected]@vue-loader/lib??vue-loader-options!./node_modules/[email protected]@vue-pdf/src/vuePdfNoSss.vue?vue&type=script&lang=js&
* worker-loader!pdfjs-dist/es5/build/pdf.worker.js in ./node_modules/[email protected]@cache-loader/dist/cjs.js??ref--12-0!./node_modules/[email protected]@thread-loader/dist/cjs.js!./node_modules/[email protected]@babel-loader/lib!./node_modules/[email protected]@cache-loader/dist/cjs.js??ref--0-0!./node_modules/[email protected]@vue-loader/lib??vue-loader-options!./node_modules/[email protected]@vue-pdf/src/vuePdfNoSss.vue?vue&type=script&lang=js&
* pdfjs-dist/es5/web/pdf_viewer in ./node_modules/[email protected]@vue-pdf/src/pdfjsWrapper.js

To install them, you can run: npm install --save pdfjs-dist/es5/build/pdf.js worker-loader!pdfjs-dist/es5/build/pdf.worker.js pdfjs-dist/es5/web/pdf_viewer
 ERROR  Build failed with errors.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `vue-cli-service build --mode production`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2021-06-08T07_24_46_457Z-debug.log
ERROR: Job failed: exit status 1

What? Can’t even run the project, so you have to be dissuaded on the first day of employment?! Reluctantly, he spent a whole day searching Baidu and Google, but he didn’t find the problem

After the meeting in the afternoon, the leader passed by his work station and saw Xiao Fang, who was in a mess, asked if the environment had been set up. At this time, Xiao Fang was already suffering from this problem and fed it back to the leaders. Unexpectedly, the leader gently put down the water cup in his hand and did a careful investigation on Xiao Fang’s work position. The leader quickly located the node_ However, it seems that this problem is rather intractable, and it has not been solved after half an hour. In the end, the leader put the node in his computer_ Moudels is copied, and the problem is found after replacement

it can be seen vaguely that Xiaofang installed the 2.8.335 version of pdfjs dist, while the leader used 2.5.207 , and this newer version is not compatible with the node environment, resulting in an error.

solve

The problem is that in the development team, the front-end project should not put the package lock. JSON file used to lock the version into gitignore, because the most critical factor of development is stability rather than the latest
hope to solve your problem, see you~

How to Sove Error: listen EADDRINUSE: address already in use 127.0.0.1:8888

The above error occurred when I was packing. At this time, I ran two projects locally

The listening address is occupied.

Open the command panel Win + r = & gt; cmd

View the process ID corresponding to the port

netstat -nao | findstr 8888

View details about the process (can be omitted)

tasklist | findstr 13964

Mission of investigation and killing:

  Method 1:

taskkill /pid 13508
#Forced termination
taskkill/F /pid 13508

  Method 2:
Ctrl + Shift + ESC, call out the task manager

NPM can’t find D: //nodejs/node all of The solution of sudden_modules/NPM/bin/npm-cli.js

Node installed with NVM

Use very normal, suddenly one day NPM error

npm -v  
NPM does not exist

node -v

Node does not exist

Baidu, very peer will tell you, re install node

If you haven’t changed environment variables and deleted files, you don’t need to

First NVM – V to see if NVM exists

If there is NVM, see if there is a node file

nvm list

 

There is a node, but it can’t be found with noe – V. then the problem is clear. Just NVM use   14.16.1, found in node – V NPM – V. Go to the next event, OK, all right

Cli4 frequently asked questions about creating projects loglevel error

Command failed: NPM install — loglevel error

Command failed: NPM install — loglevel error & amp& amp;& amp; command failed: npm install –loglevel error –registry= https://registry.npm.taobao.org The reason is whether Taobao image is selected during installationnpm install chromedriver –chromedriver_ cdnurl= http://cdn.npm.taobao.org/dist/chromedriver After completing the operation, re create the project NPM cache clean — force to clear the NPM cache If you choose Taobao image during installation, and the above two steps are not enough – & gt; Re install the following Taobao source NPM install – G cnpm — registry= https://registry.npm.taobao.org

NPM start project error: cannot find module ‘webpack’ problem solution

First install cnpm and then use cnpm i to install the package when stuck and then force to end the download and then install node_modules again after the error error, start the project when npm run serve reported the following error.
The correct approach: If you force to interrupt the download, you should remove the node_modules and reinstall them, no error after the end of the installation means success
PS D:\code\DA_svn\pages\index> npm run serve
> [email protected] serve D:\code\DA_svn\pages\index
vue-cli-service serve
INFO  Starting development server…
ERROR  Error: Cannot find module ‘webpack’
Require stack:
– D:\code\DA_svn\pages\index\node_modules\[email protected]@webpack-dev-server\lib\Server.js
– D:\code\DA_svn\pages\index\node_modules\_@[email protected]@@vue\cli-service\lib\commands\serve.js
– D:\code\DA_svn\pages\index\node_modules\_@[email protected]@@vue\cli-service\lib\Service.js
– D:\code\DA_svn\pages\index\node_modules\_@[email protected]@@vue\cli-service\bin\vue-cli-service.js
Error: Cannot find module ‘webpack’
Require stack:
– D:\code\DA_svn\pages\index\node_modules\[email protected]@webpack-dev-server\lib\Server.js
– D:\code\DA_svn\pages\index\node_modules\_@[email protected]@@vue\cli-service\lib\commands\serve.js
– D:\code\DA_svn\pages\index\node_modules\_@[email protected]@@vue\cli-service\lib\Service.js
– D:\code\DA_svn\pages\index\node_modules\_@[email protected]@@vue\cli-service\bin\vue-cli-service.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:794:15)
at Function.Module._load (internal/modules/cjs/loader.js:687:27)
at Module.require (internal/modules/cjs/loader.js:849:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Module._compile (internal/modules/cjs/loader.js:956:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
at Module.load (internal/modules/cjs/loader.js:812:32)
at Function.Module._load (internal/modules/cjs/loader.js:724:14)
at Module.require (internal/modules/cjs/loader.js:849:19)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] serve: `vue-cli-service serve`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] serve script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\pactera\AppData\Roaming\npm-cache\_logs\2021-03-09T00_59_46_004Z-debug.log

NPM install Error cb.apply is not a function

NPM install error cb.apply is not a function

solve:
Win + R open and run, enter % appdata% to delete NPM and NPM cache folder, and execute NPM cache clean — force
At this point, it should be OK. If not, uninstall node.js and install it again.

If not!!

Change yarn

Install yarn NPM install - G yarn

yarn install instead of NPM install

then, everything will be fine

NPM Install Error: npm ERR! ERESOLVE unable to resolve dependency tree

PS F:\devops_common\cloud-vue> npm cache   cache sudo npm cache clean -f
npm WARN using –force Recommended protections disabled.
npm ERR! code EUSAGE
npm ERR! npm cache
npm ERR!
npm ERR! Manipulates packages cache
npm ERR!
npm ERR! Usage:
npm ERR! npm cache add <folder>
npm ERR! npm cache add <tarball url>
npm ERR! npm cache add <git url>
npm ERR! npm cache add <name>@<version>
npm ERR! npm cache clean
npm ERR! npm cache verify
npm ERR!
npm ERR! Run “npm help cache” for more info
npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Mr\AppData\Local\npm-cache\_logs\2021-05-01T03_13_10_382Z-debug.log
PS F:\devops_common\cloud-vue> npm cache
npm ERR! code EUSAGE
npm ERR! npm cache
npm ERR!
npm ERR! Manipulates packages cache
npm ERR!
npm ERR! Usage:
npm ERR! npm cache add <folder>
npm ERR! npm cache add <name>@<version>
npm ERR! npm cache clean
npm ERR! npm cache verify
npm ERR!
npm ERR! Run “npm help cache” for more info
npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Mr\AppData\Local\npm-cache\_logs\2021-05-01T03_13_18_530Z-debug.log
PS F:\devops_common\cloud-vue> npm cache clean -f
npm WARN using –force Recommended protections disabled.
PS F:\devops_common\cloud-vue>
PS F:\devops_common\cloud-vue> npm install
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/less
npm ERR!   less@”^2.7.3″ from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer less@”^3.5.0 || ^4.0.0″ from [email protected]
npm ERR!   less-loader@”^7.3.0″ from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with –force, or –legacy-peer-deps
npm ERR!
npm ERR! See C:\Users\Mr\AppData\Local\npm-cache\eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Mr\AppData\Local\npm-cache\_logs\2021-05-01T03_14_21_801Z-debug.log
PS F:\devops_common\cloud-vue> ^C
PS F:\devops_common\cloud-vue> npm install [email protected] -g
added 2 packages, removed 236 packages, changed 3 packages, and audited 54 packages in 14s
found 0 vulnerabilities
PS F:\devops_common\cloud-vue> npm installProblem Analysis: npm version is too high
Problem solved.
npm install [email protected] -g

Using webpack to report typeerror: this.getresolve is not a function

##Using webpack to report typeerror: this.getresolve is not a function

###Error reason: the webpack version is too low or the loader version is too high

this is the original configuration version

##Solutions:
1. Upgrade the version of webpack to the highest version (there are many changes in the version of webpack, so I’m afraid it won’t catch up with others, So you can choose not to change the webpack version)
2. Reduce the version of the loader
(1) manually reduce the downloaded version of the loader in package.json

(2) download the loader you just used again

and then run it again

NPM and Node.js Version incompatibility

Today, when Xiaobian was installing dependency, he suddenly reported the following error:
. Well, although Xiaobian passed CET-4, he didn’t know which ocean to throw him into, so he went to Baidu to translate.
The result of translation is: the possible node tar or NPM version is the same as node.js This version of is not compatible. Then Xiaobian searches for answers on Baidu, saying that NPM will be downgraded, and the error prompt also says that Xiaobian should mention the version of NPM to be greater than 5.5.1 or less than 5.4.0. However, goose, Xiaobian according to it said downgrade or upgrade operation a wave as fierce as a tiger, the result, ha ha.
So, Xiaobian saw another article on Du Niang. Well, it solved the problem perfectly, so I shared it with you. Xiaobian also took notes.
NPM error

WARNING: You are likely using a version of node-tar or npm that is incompatible with this version of Node.js.
Please use either the version of npm that is bundled with Node.js, or a version of npm (> 5.5.1 or < 5.4.0) or node-tar (> 4.0.1) that is compatible with Node.js 9 and above.
npm[12696]: c:\ws\src\node_zlib.cc:568: Assertion `args.Length() == 7 && "init(windowBits, level, memLevel, strategy, writeResult, writeCallback," " dictionary)"' failed. 
 1: 00007FF7EA10363F napi_wrap+128063
 2: 00007FF7EA0A2836 v8::base::CPU::has_sse+35142
 3: 00007FF7EA0A2B53 v8::base::CPU::has_sse+35939
 4: 00007FF7EA021197 v8::internal::Debug::break_frame_id+84983
 5: 00007FF7EA86DBE0 v8::internal::Builtins::builtin_handle+323456
 6: 00007FF7EA86D127 v8::internal::Builtins::builtin_handle+320711
 7: 00007FF7EA86D468 v8::internal::Builtins::builtin_handle+321544
 8: 00007FF7EA86D26E v8::internal::Builtins::builtin_handle+321038
 9: 00007FF7EAD04EDD v8::internal::SetupIsolateDelegate::SetupHeap+546893
10: 00007FF7EAC89D8C v8::internal::SetupIsolateDelegate::SetupHeap+42748
11: 00007FF7EAC85320 v8::internal::SetupIsolateDelegate::SetupHeap+23696
12: 00007FF7EAD695C0 v8::internal::SetupIsolateDelegate::SetupHeap+958256
15: 00007FF7EAC852F7 v8::internal::SetupIsolateDelegate::SetupHeap+23655
16: 00007FF7EAD695C0 v8::internal::SetupIsolateDelegate::SetupHeap+958256
17: 00007FF7EAC89D8C v8::internal::SetupIsolateDelegate::SetupHeap+42748
18: 00007FF7EAC89D8C v8::internal::SetupIsolateDelegate::SetupHeap+42748
19: 00007FF7EAC89D8C v8::internal::SetupIsolateDelegate::SetupHeap+42748
20: 00007FF7EAC830BC v8::internal::SetupIsolateDelegate::SetupHeap+14892
21: 00007FF7EAC89D8C v8::internal::SetupIsolateDelegate::SetupHeap+42748
22: 00007FF7EAC89D8C v8::internal::SetupIsolateDelegate::SetupHeap+42748

Solution:
1. Uninstall node.js2 Delete the NPM and NPM cache (this step can’t be omitted) under C:: (users/administrator/appdata/roaming)
3. Re install nodejs. Please download the installation files from the official website and click here.
Official website address: https://nodejs.org/zh-cn/download/

4. Open the small blackboard and enter node – V and NPM – V respectively to see the corresponding version number

However, the version of nodejs installed by Xiaobian is 12.16.3, and the corresponding version of NPM is 6.14.4. Ah, in this way, Xiaobian reported another error when running NPMI in other projects: exceeding the maximum stack

Maximum call stack size exceeded

Xiaobian asked Du Niang again that the solution is to go back to a lower version of NMP, that is, to downgrade it. Ah, as a result, only the node corresponding to the lower version of NPM can be installed.

Reprint address: https://blog.csdn.net/qq_ 41241767/article/details/89465508

Error: getaddrinfo enoent error resolution

error: getaddrinfo enoent error resolution

When NPM run dev is used to run Vue project, error: getaddrinfo enoent is reported as follows:

Cause of the problem:

Localhost is not bound to 127.0.0.1

resolvent:

Find the hosts file in C:// Windows/system32/Drivers/etc , add 127.0.0.1 to the hosts file, and save it, as shown in the figure below: