Skip to content

npm run build error #97

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
tech-no-logical opened this issue May 13, 2016 · 15 comments
Closed

npm run build error #97

tech-no-logical opened this issue May 13, 2016 · 15 comments

Comments

@tech-no-logical
Copy link

from a clean clone, running this gets me

> [email protected] build /foo/angular2-webpack
> rimraf dist && webpack --progress --profile --bail

/foo/angular2-webpack/webpack.config.js:212
      new CopyWebpackPlugin([{
      ^

TypeError: CopyWebpackPlugin is not a function

the webpack config looks good to me, but I've got like zero experience with it, so I'm kind of lost :)

@kuncevic
Copy link

have you run npm install first?
On May 13, 2016 6:26 PM, "tech-no-logical" [email protected] wrote:

from a clean clone, running this gets me

[email protected] build /foo/angular2-webpack
rimraf dist && webpack --progress --profile --bail

/foo/angular2-webpack/webpack.config.js:212
new CopyWebpackPlugin([{
^

TypeError: CopyWebpackPlugin is not a function

the webpack config looks good to me, but I've got like zero experience
with it, so I'm kind of lost :)


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#97

@tech-no-logical
Copy link
Author

yup. npm start works, npm run watch works, but this one doesn't

@tech-no-logical
Copy link
Author

replacing

new CopyWebpackPlugin(...) 

with

new CopyWebpackPlugin.default(...)

fixes it for me. looks like a problem with the plugin ?

@Foxandxss
Copy link
Member

Will check later to see if there is a new version of something and broke this up

@kuncevic
Copy link

kuncevic commented May 13, 2016

npm run build working for me with

new CopyWebpackPlugin([{
        from: root('src/public')
      }])

I am on Win10, npm 3.8.5 node 5.8.0

@tech-no-logical
Copy link
Author

not on ububtu xenial with npm 3.5.2 and node 4.2.6. weird.

@kuncevic
Copy link

kuncevic commented May 13, 2016

try latest 4.x or latest 5.x node verston but not 6.x due to this one #93

@ndeitch
Copy link

ndeitch commented May 22, 2016

Hey guys,

When I run: npm run build after npm install I get some errors of TypeScript as:

ERROR in ./src/polyfills.ts
(15,3): error TS2304: Cannot find name 'require'.

And no dist folder is created.

My node version and npm version is:

node -v
v5.0.0

npm -v
3.3.6

Any thoughts?

Thx

@Foxandxss
Copy link
Member

do you have a typings folder?

@ndeitch
Copy link

ndeitch commented May 22, 2016

No, Should I? I only have a typings.json

@Foxandxss
Copy link
Member

Yes, and for some reason it is not doing it for you. Perhaps because you have an old npm (you should install a later version, they are faster).

You can generate the folder if you do

$ ./node_modules/.bin/typings install

But again, should do it for you.

@ndeitch
Copy link

ndeitch commented May 22, 2016

I exec the command U said and now it's working, the folder dist was created as expected.

I guess that this problem is because I'm running node commands as sudo, I'll fix it and update npm.

Thx for the support!

@rajeget
Copy link

rajeget commented Jul 5, 2016

I have run this code, it build the dist folder and eveything works fine. but there is nothing on browser when i open index.html . It shows loading , nothing on console as well ...

@rajeget
Copy link

rajeget commented Jul 5, 2016

answered by @Foxandxss
You need a server to serve the page. Try lite-server or http-server

$ npm install -g #lite-server
$ lite-server

That inside the dist folder.
SOLVE #120

@phra
Copy link
Member

phra commented Sep 13, 2016

i'm closing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants