vuejs-templates / browserify

A full-featured Browserify + vueify setup with hot-reload, linting & unit testing.
273 stars 85 forks source link

package.json assumes global installations #40

Closed appurist closed 7 years ago

appurist commented 7 years ago

I don't really have a problem at all with this requirement, but I didn't realize at first that the problems I was having with the browserify template were because I didn't have the following installed globally: cross-env, uglifyjs, and browserify

I think the first line of the commands specified in the readme.md should include this, or even better, a second line be inserted like inthe following: $ npm install -g vue-cli $ npm install -g cross-env uglifyjs browserify $ cd my-project $ npm install $ npm run dev

The symptom is that there is no build.js file in the dist folder after an npm build, and opening index.html just shows an empty white browser window. I think this can easily be resolved with only this small documentation update. (Or am I missing something?)

lbogdan commented 7 years ago

Really late reply (I somehow got here by searching for something unrelated), but that's not how npm scripts work:

path

If you depend on modules that define executable scripts, like test suites,
then those executables will be added to the PATH for executing the scripts.
So, if your package.json has this:
{
  "name" : "foo",
  "dependencies" : {
    "bar" : "0.1.x"
  },
  "scripts": {
    "start" : "bar ./test"
  }
}
then you could run npm start to execute the bar script, which is exported into
the node_modules/.bin directory on npm install.
appurist commented 7 years ago

Yeah, I forgot I even filed this and looking back on it now it's a bit embarrassing. I know (now) that they don't need to be installed globally, and as long as the npm run command is used, it should find the executables in the node_modules folder.

Yet the problem remains, so I think this report may be mistitled and jumping to a false conclusion of the cause. If I do a: vue init browserify blah and then:

cd blah
npm i
npm run dev

I get a blank white screen on the browser. This is due to the 404 on build.js (and a 404 on build.css which does not get resolved even on a Refresh).

I've filed a new Issue #48 on this and will close this one as it was a report of conclusions which were false, rather than just the symptoms.