For some reason, just installing nuxt
doesn't work.
"ansi-regex": "^2.0.0",
"babel-preset-es2015": "^6.18.0",
"babel-preset-stage-2": "^6.18.0",
"html-entities": "^1.2.0",
"memory-fs": "^0.3.0",
"nuxt": "^0.7.4",
"strip-ansi": "^3.0.1"
is also required.
So lets back track here.
1. Starting with just nuxt
:
$ npm i nuxt
npm WARN package.json test-foo@1.0.0 No description
npm WARN package.json test-foo@1.0.0 No repository field.
npm WARN package.json test-foo@1.0.0 No README data
npm WARN optional dep failed, continuing fsevents@1.0.15
...
nuxt@0.7.4 node_modules\nuxt
βββ pify@2.3.0
βββ serialize-javascript@1.3.0
βββ co@4.6.0
βββ es6-object-assign@1.0.3
βββ ansi-html@0.0.6
βββ hash-sum@1.0.2
βββ vuex@2.0.0
βββ vue-router@2.0.3
βββ es6-promise@4.0.5
βββ vue-meta@0.5.2 (object-assign@4.1.0, lodash.escape@4.0.1, lodash.isplainobject@4.0.6, deepmerge@1.3.0)
βββ debug@2.3.3 (ms@0.7.2)
βββ path-to-regexp@1.7.0 (isarray@0.0.1)
βββ lru-cache@4.0.1 (pseudomap@1.0.2, yallist@2.0.0)
βββ file-loader@0.9.0 (loader-utils@0.2.16)
βββ url-loader@0.5.7 (mime@1.2.11, loader-utils@0.2.16)
βββ fs-extra@1.0.0 (klaw@1.3.1, jsonfile@2.4.0, graceful-fs@4.1.11)
βββ vue-template-compiler@2.1.3 (de-indent@1.0.2, he@1.1.0)
βββ vue-server-renderer@2.1.3 (de-indent@1.0.2, he@1.1.0)
βββ webpack-hot-middleware@2.13.2 (html-entities@1.2.0, querystring@0.2.0, strip-ansi@3.0.1)
βββ cross-spawn@5.0.1 (shebang-command@1.2.0, which@1.2.12)
βββ serve-static@1.11.1 (escape-html@1.0.3, encodeurl@1.0.1, parseurl@1.3.1, send@0.14.1)
βββ glob@7.1.1 (path-is-absolute@1.0.1, inherits@2.0.3, fs.realpath@1.0.0, once@1.4.0, inflight@1.0.6, minimatch@3.0.3)
βββ extract-text-webpack-plugin@2.0.0-beta.4 (async@1.5.2, loader-utils@0.2.16, webpack-sources@0.1.3)
βββ babel-loader@6.2.8 (object-assign@4.1.0, loader-utils@0.2.16, mkdirp@0.5.1, find-cache-dir@0.1.1)
βββ webpack-dev-middleware@1.8.4 (path-is-absolute@1.0.1, range-parser@1.2.0, mime@1.3.4, memory-fs@0.3.0)
βββ vue@2.1.3
βββ chokidar@1.6.1 (path-is-absolute@1.0.1, inherits@2.0.3, async-each@1.0.1, glob-parent@2.0.0, is-glob@2.0.1, is-binary-path@1.0.1, readdirp@2.1.0, anymatch@1.3.0)
βββ vue-loader@10.0.1 (object-assign@4.1.0, vue-hot-reload-api@2.0.6, vue-style-loader@1.0.0, vue-template-es2015-compiler@1.3.0, loader-utils@0.2.16, source-map@0.5.6, postcss-selector-parser@2.2.2, consolidate@0.14.5, postcss@5.2.6, js-beautify@1.6.4)
βββ css-loader@0.26.0 (postcss-modules-extract-imports@1.0.1, object-assign@4.1.0, lodash.camelcase@4.3.0, loader-utils@0.2.16, postcss-modules-values@1.2.2, source-list-map@0.1.6, babel-code-frame@6.16.0, css-selector-tokenizer@0.7.0, postcss-modules-scope@1.0.2, postcss-modules-local-by-default@1.1.1, postcss@5.2.6, cssnano@3.8.1)
βββ webpack@2.1.0-beta.27 (object-assign@4.1.0, interpret@1.0.1, tapable@0.2.4, supports-color@3.1.2, ajv-keywords@1.1.1, loader-runner@2.2.0, source-map@0.5.6, loader-utils@0.2.16, mkdirp@0.5.1, enhanced-resolve@2.3.0, acorn@4.0.3, memory-fs@0.3.0, webpack-sources@0.1.3, async@2.1.4, watchpack@1.1.0, ajv@4.9.0, uglify-js@2.7.4, node-libs-browser@1.1.1, yargs@6.4.0)
βββ autoprefixer@6.5.3 (normalize-range@0.1.2, num2fraction@1.2.2, postcss-value-parser@3.3.0, browserslist@1.4.0, postcss@5.2.6, caniuse-db@1.0.30000587)
βββ lodash@4.17.2
βββ babel-core@6.18.2 (slash@1.0.0, babel-messages@6.8.0, path-is-absolute@1.0.1, babel-template@6.16.0, babel-helpers@6.16.0, private@0.1.6, json5@0.5.0, babylon@6.14.1, convert-source-map@1.3.0, source-map@0.5.6, babel-types@6.19.0, minimatch@3.0.3, babel-code-frame@6.16.0, babel-traverse@6.19.0, babel-generator@6.19.0, babel-register@6.18.0, babel-runtime@6.18.0)
βββ [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
βββ babel-preset-stage-2@6.18.0 (babel-plugin-syntax-dynamic-import@6.18.0, babel-plugin-transform-decorators@6.13.0, babel-plugin-transform-class-properties@6.19.0, babel-preset-stage-3@6.17.0)
npm run dev
> test-foo@1.0.0 dev C:\Users\zenobius\Projects\test-foo
> nuxt
nuxt:build App root: C:\Users\zenobius\Projects\test-foo +0ms
nuxt:build Generating .nuxt/ files... +2ms
nuxt:build Generating routes... +6ms
nuxt:build Generating files... +3ms
nuxt:build Adding webpack middlewares... +25ms
{ Error: Cannot find module 'memory-fs'
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Nuxt.webpackWatchAndUpdate (C:\Users\zenobius\Projects\test-foo\node_modules\nuxt\lib\build\index.js:250:15)
at Nuxt.module.exports (C:\Users\zenobius\Projects\test-foo\node_modules\nuxt\lib\build\index.js:129:27)
at next (native)
at onFulfilled (C:\Users\zenobius\Projects\test-foo\node_modules\nuxt\node_modules\co\index.js:65:19) code: 'MODULE_NOT_FOUND' }
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files (x86)\\Nodist\\v-x64\\6.9.1\\node.exe" "C:\\Program Files (x86)\\Nodist\\npmv\\2.15.10\\bin\\npm-cli.js" "run" "dev"
npm ERR! node v6.9.1
npm ERR! npm v2.15.10
npm ERR! code ELIFECYCLE
npm ERR! test-foo@1.0.0 dev: `nuxt`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the test-foo@1.0.0 dev script 'nuxt'.
npm ERR! This is most likely a problem with the test-foo package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! nuxt
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs test-foo
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR! npm owner ls test-foo
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\zenobius\Projects\test-foo\npm-debug.log
Nope...
2. adding memory-fs
$ npm run dev
> test-foo@1.0.0 dev C:\Users\zenobius\Projects\test-foo
> nuxt
nuxt:build App root: C:\Users\zenobius\Projects\test-foo +0ms
nuxt:build Generating .nuxt/ files... +2ms
nuxt:build Generating routes... +5ms
nuxt:build Generating files... +2ms
nuxt:build Adding webpack middlewares... +19ms
Ready on http://localhost:3000
./.nuxt/server.js
Module build failed: Error: Couldn't find preset "es2015" relative to directory "C:\\Users\\zenobius\\Projects\\test-foo"
at C:\Users\zenobius\Projects\test-foo\node_modules\nuxt\node_modules\babel-core\lib\transformation\file\options\option-manager.js:299:19
at Array.map (native)
at OptionManager.resolvePresets (C:\Users\zenobius\Projects\test-foo\node_modules\nuxt\node_modules\babel-core\lib\transformation\file\options\option-manager.js:270:20)
at OptionManager.mergePresets (C:\Users\zenobius\Projects\test-foo\node_modules\nuxt\node_modules\babel-core\lib\transformation\file\options\option-manager.js:259:10)
at OptionManager.mergeOptions (C:\Users\zenobius\Projects\test-foo\node_modules\nuxt\node_modules\babel-core\lib\transformation\file\options\option-manager.js:244:14)
at OptionManager.init (C:\Users\zenobius\Projects\test-foo\node_modules\nuxt\node_modules\babel-core\lib\transformation\file\options\option-manager.js:374:12)
at File.initOptions (C:\Users\zenobius\Projects\test-foo\node_modules\nuxt\node_modules\babel-core\lib\transformation\file\index.js:216:65)
at new File (C:\Users\zenobius\Projects\test-foo\node_modules\nuxt\node_modules\babel-core\lib\transformation\file\index.js:139:24)
at Pipeline.transform (C:\Users\zenobius\Projects\test-foo\node_modules\nuxt\node_modules\babel-core\lib\transformation\pipeline.js:46:16)
at transpile (C:\Users\zenobius\Projects\test-foo\node_modules\nuxt\node_modules\babel-loader\lib\index.js:41:20)
webpack built 53381c8f33547a6b069d in 740ms
Hash: 53381c8f33547a6b069d
Version: webpack 2.1.0-beta.27
Time: 740ms
Asset Size Chunks Chunk Names
nuxt.bundle.js 23.2 kB 0 app
vendor.bundle.js 301 kB 1 vendor
nuxt.bundle.js.map 26.7 kB 0 app
vendor.bundle.js.map 369 kB 1 vendor
ERROR in (webpack)-hot-middleware/client.js?reload=true
Module not found: Error: Can't resolve 'strip-ansi' in 'C:\Users\zenobius\Projects\test-foo\node_modules\nuxt\node_modules\webpack-hot-middleware'
@ (webpack)-hot-middleware/client.js?reload=true 95:14-35
@ multi app
ERROR in (webpack)-hot-middleware/client-overlay.js
Module not found: Error: Can't resolve 'html-entities' in 'C:\Users\zenobius\Projects\test-foo\node_modules\nuxt\node_modules\webpack-hot-middleware'
@ (webpack)-hot-middleware/client-overlay.js 40:15-39
@ (webpack)-hot-middleware/client.js?reload=true
@ multi app
ERROR in ./.nuxt/client.js
Module build failed: Error: Couldn't find preset "es2015" relative to directory "C:\\Users\\zenobius\\Projects\\test-foo"
at C:\Users\zenobius\Projects\test-foo\node_modules\nuxt\node_modules\babel-core\lib\transformation\file\options\option-manager.js:299:19
at Array.map (native)
at OptionManager.resolvePresets (C:\Users\zenobius\Projects\test-foo\node_modules\nuxt\node_modules\babel-core\lib\transformation\file\options\option-manager.js:270:20)
at OptionManager.mergePresets (C:\Users\zenobius\Projects\test-foo\node_modules\nuxt\node_modules\babel-core\lib\transformation\file\options\option-manager.js:259:10)
at OptionManager.mergeOptions (C:\Users\zenobius\Projects\test-foo\node_modules\nuxt\node_modules\babel-core\lib\transformation\file\options\option-manager.js:244:14)
at OptionManager.init (C:\Users\zenobius\Projects\test-foo\node_modules\nuxt\node_modules\babel-core\lib\transformation\file\options\option-manager.js:374:12)
at File.initOptions (C:\Users\zenobius\Projects\test-foo\node_modules\nuxt\node_modules\babel-core\lib\transformation\file\index.js:216:65)
at new File (C:\Users\zenobius\Projects\test-foo\node_modules\nuxt\node_modules\babel-core\lib\transformation\file\index.js:139:24)
at Pipeline.transform (C:\Users\zenobius\Projects\test-foo\node_modules\nuxt\node_modules\babel-core\lib\transformation\pipeline.js:46:16)
at transpile (C:\Users\zenobius\Projects\test-foo\node_modules\nuxt\node_modules\babel-loader\lib\index.js:41:20)
@ multi app
Which spams the terminal with errors forever until ctrl+c
3. add those missing libs
$ npm i -S html-entities ansi-regex babel-preset-stage-2 babel-preset-es2015
npm WARN package.json test-foo@1.0.0 No description
npm WARN package.json test-foo@1.0.0 No repository field.
npm WARN package.json test-foo@1.0.0 No README data
ansi-regex@2.0.0 node_modules\ansi-regex
html-entities@1.2.0 node_modules\html-entities
babel-preset-es2015@6.18.0 node_modules\babel-preset-es2015
βββ babel-plugin-transform-es2015-literals@6.8.0 (babel-runtime@6.18.0)
βββ babel-plugin-transform-es2015-duplicate-keys@6.8.0 (babel-types@6.19.0, babel-runtime@6.18.0)
βββ babel-plugin-transform-es2015-modules-umd@6.18.0 (babel-template@6.16.0, babel-runtime@6.18.0)
βββ babel-plugin-transform-es2015-modules-amd@6.18.0 (babel-template@6.16.0, babel-runtime@6.18.0)
βββ babel-plugin-transform-es2015-block-scoped-functions@6.8.0 (babel-runtime@6.18.0)
βββ babel-plugin-transform-es2015-typeof-symbol@6.18.0 (babel-runtime@6.18.0)
βββ babel-plugin-transform-es2015-computed-properties@6.8.0 (babel-template@6.16.0, babel-helper-define-map@6.18.0, babel-runtime@6.18.0)
βββ babel-plugin-transform-es2015-sticky-regex@6.8.0 (babel-helper-regex@6.18.0, babel-types@6.19.0, babel-runtime@6.18.0)
βββ babel-plugin-transform-es2015-template-literals@6.8.0 (babel-runtime@6.18.0)
βββ babel-plugin-transform-es2015-destructuring@6.19.0 (babel-runtime@6.18.0)
βββ babel-plugin-transform-es2015-for-of@6.18.0 (babel-runtime@6.18.0)
βββ babel-plugin-transform-es2015-shorthand-properties@6.18.0 (babel-types@6.19.0, babel-runtime@6.18.0)
βββ babel-plugin-transform-es2015-modules-systemjs@6.19.0 (babel-template@6.16.0, babel-helper-hoist-variables@6.18.0, babel-runtime@6.18.0)
βββ babel-plugin-transform-es2015-unicode-regex@6.11.0 (regexpu-core@2.0.0, babel-helper-regex@6.18.0, babel-runtime@6.18.0)
βββ babel-plugin-transform-es2015-arrow-functions@6.8.0 (babel-runtime@6.18.0)
βββ babel-plugin-transform-es2015-modules-commonjs@6.18.0 (babel-plugin-transform-strict-mode@6.18.0, babel-template@6.16.0, babel-types@6.19.0, babel-runtime@6.18.0)
βββ babel-plugin-transform-es2015-object-super@6.8.0 (babel-helper-replace-supers@6.18.0, babel-runtime@6.18.0)
βββ babel-plugin-transform-es2015-parameters@6.18.0 (babel-helper-get-function-arity@6.18.0, babel-helper-call-delegate@6.18.0, babel-template@6.16.0, babel-types@6.19.0, babel-traverse@6.19.0, babel-runtime@6.18.0)
βββ babel-plugin-transform-es2015-block-scoping@6.18.0 (babel-template@6.16.0, babel-types@6.19.0, babel-traverse@6.19.0, lodash@4.17.2, babel-runtime@6.18.0)
βββ babel-plugin-transform-es2015-function-name@6.9.0 (babel-types@6.19.0, babel-helper-function-name@6.18.0, babel-runtime@6.18.0)
βββ babel-plugin-transform-es2015-spread@6.8.0 (babel-runtime@6.18.0)
βββ babel-plugin-check-es2015-constants@6.8.0 (babel-runtime@6.18.0)
βββ babel-plugin-transform-es2015-classes@6.18.0 (babel-helper-replace-supers@6.18.0, babel-helper-optimise-call-expression@6.18.0, babel-messages@6.8.0, babel-helper-function-name@6.18.0, babel-template@6.16.0, babel-helper-define-map@6.18.0, babel-types@6.19.0, babel-traverse@6.19.0, babel-runtime@6.18.0)
βββ babel-plugin-transform-regenerator@6.16.1 (private@0.1.6, babel-types@6.19.0, babel-runtime@6.18.0)
babel-preset-stage-2@6.18.0 node_modules\babel-preset-stage-2
βββ babel-plugin-syntax-dynamic-import@6.18.0
βββ babel-plugin-transform-decorators@6.13.0 (babel-plugin-syntax-decorators@6.13.0, babel-helper-define-map@6.18.0, babel-template@6.16.0, babel-types@6.19.0, babel-helper-explode-class@6.18.0, babel-runtime@6.18.0)
βββ babel-plugin-transform-class-properties@6.19.0 (babel-plugin-syntax-class-properties@6.13.0, babel-template@6.16.0, babel-helper-function-name@6.18.0, babel-runtime@6.18.0)
βββ babel-preset-stage-3@6.17.0 (babel-plugin-syntax-trailing-function-commas@6.13.0, babel-plugin-transform-async-to-generator@6.16.0, babel-plugin-transform-exponentiation-operator@6.8.0, babel-plugin-transform-async-generator-functions@6.17.0, babel-plugin-transform-object-rest-spread@6.19.0)
$ npm run dev
> test-foo@1.0.0 dev C:\Users\zenobius\Projects\test-foo
> nuxt
nuxt:build App root: C:\Users\zenobius\Projects\test-foo +0ms
nuxt:build Generating .nuxt/ files... +3ms
nuxt:build Generating routes... +5ms
nuxt:build Generating files... +3ms
nuxt:build Adding webpack middlewares... +20ms
Ready on http://localhost:3000
Boom. getting somewhere... but, without loading any pages:
ERROR in (webpack)-hot-middleware/client.js?reload=true
Module not found: Error: Can't resolve 'strip-ansi' in 'C:\Users\zenobius\Projects\test-foo\node_modules\nuxt\node_modules\webpack-hot-middleware'
@ (webpack)-hot-middleware/client.js?reload=true 95:14-35
@ multi app
4. install yet more missing libs
$ npm i --save strip-ansi
npm WARN package.json test-foo@1.0.0 No description
npm WARN package.json test-foo@1.0.0 No repository field.
npm WARN package.json test-foo@1.0.0 No README data
strip-ansi@3.0.1 node_modules\strip-ansi
$ npm run dev
> test-foo@1.0.0 dev C:\Users\zenobius\Projects\test-foo
> nuxt
nuxt:build App root: C:\Users\zenobius\Projects\test-foo +0ms
nuxt:build Generating .nuxt/ files... +3ms
nuxt:build Generating routes... +7ms
nuxt:build Generating files... +3ms
nuxt:build Adding webpack middlewares... +18ms
Ready on http://localhost:3000
webpack built ee46c8438c3a8b6ffca2 in 9442ms
webpack building...
webpack built ee46c8438c3a8b6ffca2 in 86ms
nuxt:render Rendering url / +10s
webpack building...
webpack built ee46c8438c3a8b6ffca2 in 131ms
Getting somewhere now.
$ curl http://localhost:3000
<!DOCTYPE html>
<html n-head-ssr n-head="">
<head>
<title n-head="true">This page could not be found.</title>
<base href="/">
</head>
<body n-head="">
<div id="__nuxt" server-rendered="true"><div><div class="progress" style="width:0%;height:2px;background-color:black;opacity:0" data-v-0cc8389e></div> <div class="error-page" data-v-5367edcf><div data-v-5367edcf><h1 class="error-code" data-v-5367edcf>404</h1> <div class="error-wrapper-message" data-v-5367edcf><h2 class="error-message" data-v-5367edcf>This page could not be found.</h2></div> <p data-v-5367edcf><a href="/" class="error-link router-link-active" data-v-5367edcf>Back to the home page</a></p></div></div></div></div>
<script type="text/javascript" defer>window.__NUXT__={"data":[],"error":{"statusCode":404,"message":"This page could not be found.","url":"\u002F"},"serverRendered":true}</script>
<script src="/_nuxt/vendor.bundle.js" defer></script>
<script src="/_nuxt/nuxt.bundle.js" defer></script>
</body>
</html>
Boom. much success. yes.
This question is available on Nuxt.js community (#c5)