环境:win10, node版本为v10.16.3
问题背景:使用vuepress构建项目,流程如下代码所示
# 将 VuePress 作为一个本地依赖安装
yarn add -D vuepress # 或者:npm install -D vuepress
# 新建一个 docs 文件夹
mkdir docs
# 新建一个 markdown 文件
echo '# Hello VuePress!' > docs/README.md
# 开始写作
npx vuepress dev docs
问题现象:
执行npx vuepress dev docs出现如下错误
G:\>npx vuepress dev docs
(node:14064) UnhandledPromiseRejectionWarning: Error: EPERM: operation not permitted, lstat 'G:\System Volume Information'
(node:14064) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:14064) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
问题原因:
我的项目直接构建在G盘的盘符下,创建的docs文件
解决问题:
将docs文件夹放到了G:/node-workspace文件夹下