Tag Archives: View.js

How to Solve NPM installation -g @view/client Error

Installation problem: NPM install – G @ Vue/cli   Long string error reporting

npm ERR! code 1
npm ERR! path C:\Users\A\AppData\Roaming\npm\node_modules\@vue\cli\node_modules\bufferutil
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node-gyp rebuild
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | win32 | x64
npm ERR! gyp info find Python using Python version 2.7.10 found at "C:\Python27\python.exe"
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! find VS msvs_version not set from command line or npm config
npm ERR! gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
npm ERR! gyp ERR! find VS could not use PowerShell to find Visual Studio 2017 or newer, try re-running with '--loglevel silly' for more details
npm ERR! gyp ERR! find VS looking for Visual Studio 2015
npm ERR! gyp ERR! find VS - not found
npm ERR! gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! find VS **************************************************************
npm ERR! gyp ERR! find VS You need to install the latest version of Visual Studio
npm ERR! gyp ERR! find VS including the "Desktop development with C++" workload.
npm ERR! gyp ERR! find VS For more information consult the documentation at:
npm ERR! gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows
npm ERR! gyp ERR! find VS **************************************************************
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Could not find any Visual Studio installation to use
npm ERR! gyp ERR! stack     at VisualStudioFinder.fail (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:121:47)
npm ERR! gyp ERR! stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:74:16
npm ERR! gyp ERR! stack     at VisualStudioFinder.findVisualStudio2013 (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:351:14)
npm ERR! gyp ERR! stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:70:14
npm ERR! gyp ERR! stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:372:16
npm ERR! gyp ERR! stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\util.js:54:7
npm ERR! gyp ERR! stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\util.js:33:16
npm ERR! gyp ERR! stack     at ChildProcess.exithandler (node:child_process:404:5)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:394:28)
npm ERR! gyp ERR! stack     at maybeClose (node:internal/child_process:1064:16)
npm ERR! gyp ERR! System Windows_NT 10.0.19042
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd C:\Users\A\AppData\Roaming\npm\node_modules\@vue\cli\node_modules\bufferutil
npm ERR! gyp ERR! node -v v16.7.0
npm ERR! gyp ERR! node-gyp -v v7.1.2
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\A\AppData\Local\npm-cache\_logs\2021-09-16T09_15_40_144Z-debug.log

the error reporting information found is almost the same, but it is different from mine!

Solution:

1. Find the path of user folder

2. Delete the. Npmrc and. Nrmrc files under the path

  3. Re execute NPM I – G @ Vue/cli — force

–Force force to cover the previous scaffold

  4. Execute Vue – V to check the version

So far, the problem has been solved.

[Solved] Vue Error: Module build failed Error Node Sass version 6.0.1 is incompatible with ^4.0.0.

Vue error module build failed: error: node sass version 6.0.1 is incompatible with ^ 4.0.0. Solution

Error message:

 ERROR  Failed to compile with 1 errors                                                                                                                                      下午6:51:57
 
 error  in ./src/views/Login.vue
 
Module build failed: Error: Node Sass version 6.0.1 is incompatible with ^4.0.0.
    at getSassImplementation (D:\IDEA\IDEA Projects\Vue\hello-vue\node_modules\[email protected]@sass-loader\dist\utils.js:77:13)
    at Object.loader (D:\IDEA\IDEA Projects\Vue\hello-vue\node_modules\[email protected]@sass-loader\dist\index.js:34:59)
 
 @ ./node_modules/vue-style-loader!./node_modules/css-loader?{"sourceMap":true}!./node_modules/vue-loader/lib/style-compiler?{"vue":true,"id":"data-v-26084dc2","scoped":true,"hasInline
Config":false}!./node_modules/[email protected]@sass-loader/dist/cjs.js?{"sourceMap":true}!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/views/Login.vue 4:14-389
 13:3-17:5 14:22-397
 @ ./src/views/Login.vue
 @ ./src/router/index.js
 @ ./src/main.js
 @ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server ./src/main.js

Solution:

Find the problem: module build failed: error: node sass version 6.0.1 is incompatible with ^ 4.0.0

This problem is caused by the high version of SASS, so just change the version to the corresponding version according to the prompt. Here, change to version 4.0.0.

Step 1: find the package.json file in the IDE:

Step 2: find sass loader and change its version to 4.0.0

Finally, execute

cnpm install

Finally, execute

cnpm install

npm run dev

[vue/no-parsing-error]Parsing error: control-character-in-input-stream.eslint-plugin-vue

Problem background:

Similar to the figure below, the label is clearly closed, but still red.

  solve the problem:

In fact, there are no errors in the code. For example, after using the element UI or iView framework, you will find that some parts of vs code will automatically mark red wavy lines,  

In fact, it is a syntax check problem for vuter. You only need to add it in setting.json  

“vetur.validation.template”: false

Setting method:

 

 

Create Vue cli project and report error command failed: Yarn

Create Vue cli project and report error command failed: Yarn

Solution 1:

Enter C:/users/administrator/in the windows environment

There is a file . Vuerc

Open this file to display

{
“useTaobaoRegistry”: true,
“packageManager”: “yarn”
}

Just manually change the configuration content yarn to NPM to change the package manager when the project is created


Solution 2:

Delete the. Vuerc file. When you create a Vue project for the first time, you will be prompted to select the configuration, and then select NPM.


Solution 3: enter CMD in Win + R to enter the command line interface

Enter command

npm install -g yarn

After success, the problem can be solved by re creating vue-cli4 project.

Cannot read property ‘isFile‘ of undefined [How to Solve]

Today, when I started the project, I couldn’t get up. I always reported an error. After translation research, I came to the solution

When executing Vue project NPM run dev FileManager webpack plugin error typeerror: cannot read property 'isfile' of undefined

D:\abinwork\fmis_web\node_modules\filemanager-webpack-plugin\lib\index.js:271
        if (isGlob) archive.glob(command.source, globOptions);else if (sStats.isFile()) archive.file(command.source, { 
        name: path$1.basename(command.source) });else if (sStats.isDirectory()) archive.glob('**/*', {
                                                                              ^

TypeError: Cannot read property 'isFile' of undefined
    at D:\abinwork\fmis_web\node_modules\filemanager-webpack-plugin\lib\index.js:271:79
    at D:\abinwork\fmis_web\node_modules\graceful-fs\polyfills.js:282:31

The reason for the error is very simple, because the project we just pulled down does not have a dist directory, and then FileManager webpack plugin find a dist directory and find that it does not exist, and then strike and quit, resulting in an error;

There are two solutions

First, you can repackage it;

npm run build

Second, modify the configuration and automatically create the dist directory when running

Note: look at the first step first. If you can run the NPM run build and then the NPM run dev project, you don’t have to perform the second step

plugins: [
    new FileManagerWebpackPlugin ({
      onEnd: {
        mkdir: [‘./dist‘],
        delete: [
          ‘./dist.zip‘,
        ],
        archive: [
          {source: ‘./dist‘, destination: ‘./dist.zip‘},
        ]
      }
    })
  ],