question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

npm run build fails

See original GitHub issue

What example does this report relate to?

with-typescript

What version of Next.js are you using?

10.2.0

What version of Node.js are you using?

v14.15.3

What browser are you using?

chrome

What operating system are you using?

Windows

How are you deploying your application?

none

Describe the Bug

Hi,

I am getting problem with creating a build version via npm run build with the typescript example. My personal project fails at every build. So I made a clean copy from the typescript example but even without changing the code it fails.

this is the error

[=   ] info  - Generating static pages (0/9)npm ERR! code ELIFECYCLE
npm ERR! errno 3221225477
npm ERR! with-typescript@1.0.0 build: `next build`
npm ERR! Exit status 3221225477
npm ERR!
npm ERR! Failed at the with-typescript@1.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

this is from the logs.

0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli   'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'run',
1 verbose cli   'build'
1 verbose cli ]
2 info using npm@6.14.9
3 info using node@v14.15.3
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle with-typescript@1.0.0~prebuild: with-typescript@1.0.0
6 info lifecycle with-typescript@1.0.0~build: with-typescript@1.0.0
7 verbose lifecycle with-typescript@1.0.0~build: unsafe-perm in lifecycle true
8 verbose lifecycle with-typescript@1.0.0~build: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;D:\Projects\nextjsbug\with-typescript-app\node_modules\.bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files\nodejs\;C:\Program Files\Git\cmd;C:\Users\Maxime\AppData\Local\Programs\Python\Python39\Scripts\;C:\Users\Maxime\AppData\Local\Programs\Python\Python39\;C:\Users\Maxime\AppData\Local\Microsoft\WindowsApps;C:\Users\Maxime\AppData\Local\GitHubDesktop\bin;D:\Microsoft VS Code\bin;C:\Users\Maxime\AppData\Roaming\npm;D:\Pycharm\PyCharm Community Edition 2020.3.3\bin;
9 verbose lifecycle with-typescript@1.0.0~build: CWD: D:\Projects\nextjsbug\with-typescript-app
10 silly lifecycle with-typescript@1.0.0~build: Args: [ '/d /s /c', 'next build' ]
11 silly lifecycle with-typescript@1.0.0~build: Returned: code: 3221225477  signal: null
12 info lifecycle with-typescript@1.0.0~build: Failed to exec build script
13 verbose stack Error: with-typescript@1.0.0 build: `next build`
13 verbose stack Exit status 3221225477
13 verbose stack     at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack     at EventEmitter.emit (events.js:315:20)
13 verbose stack     at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:315:20)
13 verbose stack     at maybeClose (internal/child_process.js:1048:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
14 verbose pkgid with-typescript@1.0.0
15 verbose cwd D:\Projects\nextjsbug\with-typescript-app
16 verbose Windows_NT 10.0.19042
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "build"
18 verbose node v14.15.3
19 verbose npm  v6.14.9
20 error code ELIFECYCLE
21 error errno 3221225477
22 error with-typescript@1.0.0 build: `next build`
22 error Exit status 3221225477
23 error Failed at the with-typescript@1.0.0 build script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 3221225477, true ]

Expected Behavior

I expect it to build without error

To Reproduce

  1. npx create-next-app --example with-typescript with-typescript-app
  2. npm run dev
  3. npm run build

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
stpchcommented, May 4, 2021

Update: Upgrading to node v14.16.1 (latest LTS) fixed the issue for me.

0reactions
balazsorban44commented, Jan 28, 2022

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

npm run build - fails to compile despite development version ...
I have a react app created with create-react-app , and npm run build is failing to compile a production build. It throws the...
Read more >
`npm run build` is failing on CI but runs fine on local machine
Hey I got really weird problem. I use CRA with TypeScript template. I cannot build my app using npm run build on Github...
Read more >
npm run build command fails - Salesforce Stack Exchange
x.x/guide/getting-started/ and when I run the npm run build command I get an error "NODE_ENV" is not recognized as an internal or external ......
Read more >
Error when running npm run build : r/react - Reddit
Error when running npm run build · Delete package-lock.json (not package.json!) and/or yarn. · Delete node_modules in your project folder. · Remove ...
Read more >
superset build failures - npm run build - Google Groups
cd $SUPERSETHOME/superset/assets. npm install # this works fine · npm run build # this step errors out · Error: + 2221 hidden modules...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found