前端异常 - 走向前端,填下的坑和异常

1. NPM 命令执行 报错

D:\webworkspace\WebpackDemo>npm -v
module.js:327
    throw err;
    ^

Error: Cannot find module 'semver'
    at Function.Module._resolveFilename (module.js:325:15)
    at Function.Module._load (module.js:276:25)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object. (C:\Users\yuan\AppData\Roaming\npm\node_modules\npm\lib\utils\unsupported.js:2:14)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)

解决:

删除下面目录即可,重新运行!

C:\Users\yuan\AppData\Roaming\npm
C:\Users\yuan\AppData\Roaming\npm-cache

2. ESLint 字符串模板

Problem with ESLint reformatting:
            xxx.js: Unexpected template string expression. (no-template-curly-in-string) (show balloon)

解决:

使用键盘 tab键上面的引号 ,非 enter 键旁边的引号

http://eslint.org/docs/rules/no-template-curly-in-string

你可能感兴趣的:(前端异常 - 走向前端,填下的坑和异常)