Create brand new vuepress site and install @vuepress/google-analytics.
Google analytics code to be added to the output when building for production.
Warning is displayed during the build process
warning [vuepress] cannot resolve plugin "@vuepress/google-analytics"
I also tried to change the config key to @vuepress/plugin-google-analytics as this is the name of the plugin in package.json but nothing changed.
My config.js file has the following code:
module.exports = {
plugins: [
['@vuepress/plugin-google-analytics', {
ga: 'UA-29469126-4'
}]
]
};
[ ] My VuePress version is lower and euqal than 1.0.0-alpha.47:
[x] My VuePress version is higher than 1.0.0-alpha.47, the following is the output of vuepress info in my VuePress project:
Environment Info:
System:
OS: macOS 10.14.4
CPU: (8) x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
Binaries:
Node: 8.15.0 - /usr/local/opt/node@8/bin/node
Yarn: 1.15.2 - /usr/local/bin/yarn
npm: 6.4.1 - /usr/local/opt/node@8/bin/npm
Browsers:
Chrome: 74.0.3729.157
Firefox: 64.0.2
Safari: 12.1
npmPackages:
@vuepress/core: Not Found
@vuepress/theme-default: Not Found
vuepress: Not Found
npmGlobalPackages:
vuepress: Not Found
npx vuepress info actually resulted in the following error:
Usage: vuepress <command> [options]
Options:
-V, --version output the version number
-h, --help output usage information
Commands:
dev [options] [targetDir] start development server
build [options] [targetDir] build dir as static site
eject [targetDir] copy the default theme into .vuepress/theme for customization.
Run vuepress <command> --help for detailed usage of given command.
Unknown command info.
Same issue here
I've just fixed by including "vuepress": "^1.0.0-alpha.48" on my package.json file and running yarn install
Unfortunately I am not having your success. The contents of my package.json is as follows:
{
"dependencies": {
"@vuepress/plugin-google-analytics": "^1.0.0-alpha.48"
}
}
and my config.js (as in the docs):
module.exports = {
plugins: [
['@vuepress/google-analytics', {
'ga': 'UA-29469126-4'
}]
]
};
Yeah, it seems that the plugins must be included in the local package.json. For instance, this file works fine:
{
"scripts": {
"docs:dev": "vuepress dev docs",
"docs:build": "vuepress build docs"
},
"devDependencies": {
"@vuepress/plugin-back-to-top": "^1.0.1",
"@vuepress/plugin-google-analytics": "^1.0.1",
"vuepress": "^1.0.1"
}
}
It seems that this issue doesn't exist, please use the latest version of vuepress.
It seems that this issue doesn't exist, please use the latest version of vuepress.
@ulivz Wast me one night to make it work!!
Cannot resolve plugin ** when Vuepress is installed globally. You should put Vuepress locally.
Environment Info: [With question]
npmPackages:
@vuepress/core: Not Found
@vuepress/theme-default: Not Found
vuepress: Not Found
npmGlobalPackages:
vuepress: 1.0.2
Environment Info: [OK]
npmPackages:
@vuepress/core: 1.0.2
@vuepress/theme-default: 1.0.2
vuepress: ^1.0.2 => 1.0.2
npmGlobalPackages:
vuepress: 1.0.2
It's the solution:
I've just fixed by including "vuepress": "^1.0.0-alpha.48" on my package.json file and running yarn install
Most helpful comment
I've just fixed by including
"vuepress": "^1.0.0-alpha.48"on my package.json file and runningyarn install