Closed tsabat closed 5 years ago
@tsabat Thanks for the details.
RE: Maybe a new version has stopped creating this file?
Don't believe new versions have stopped creating the package.json
. As part of jets new
a jets webpacker:install
command gets ran. Here's the area of the code:
Unsure here. Wondering if it might be a yarn or node setup or version thing? Just tested it and it created the package.json
π€
$ jets --version
1.6.9
$ jets new demo --database=postgresql
Creating new project called demo.
create demo
...
$ ls demo/package.json
demo/package.json
$ node --version
v8.10.0
$ yarn --version
1.9.4
$
Full gist: https://gist.github.com/tongueroo/1a3b27edfaa5033ed2332767f2b5c08a
Here's mine
visinote/jets_demo/demo on ξ master [!?]
[I] β jets --version
1.6.9
visinote/jets_demo/demo on ξ master [!?] took 3s
[I] β node --version
v8.15.0
visinote/jets_demo/demo on ξ master [!?]
[I] β yarn --version
1.13.0
as you can see in the original ticket, the yarn install happens, but the node_modules
directory is not created at the root of my project and the package.json
is missing:
[I] β ls -lh
total 28K
-rw-r--r-- 1 timothysabat staff 684 Feb 8 09:16 Gemfile
-rw-r--r-- 1 timothysabat staff 4.7K Feb 8 09:16 Gemfile.lock
-rw-r--r-- 1 timothysabat staff 282 Feb 8 09:16 Procfile
-rw-r--r-- 1 timothysabat staff 256 Feb 8 09:16 README.md
-rw-r--r-- 1 timothysabat staff 31 Feb 8 09:16 Rakefile
drwxr-xr-x 8 timothysabat staff 256 Feb 8 09:16 app
drwxr-xr-x 4 timothysabat staff 128 Feb 8 09:16 bin
drwxr-xr-x 9 timothysabat staff 288 Feb 8 09:16 config
-rw-r--r-- 1 timothysabat staff 115 Feb 8 09:16 config.ru
drwxr-xr-x 4 timothysabat staff 128 Feb 8 09:26 db
drwxr-xr-x 7 timothysabat staff 224 Feb 8 09:16 public
drwxr-xr-x 5 timothysabat staff 160 Feb 8 09:16 spec
drwxr-xr-x 3 timothysabat staff 96 Feb 8 09:26 tmp
Any suggestions for debugging? I'm not scared of the command line, but I'm unfamiliar with the node ecosystem.
here's me installing webpack individually.
identical config/webpacker.yml
Copying webpack core config
exist config/webpack
identical config/webpack/development.js
conflict config/webpack/environment.js
Overwrite /Users/timothysabat/Development/visinote/jets_demo/demo/config/webpack/environment.js? (enter "h" for help) [Ynaqdhm]
force config/webpack/environment.js
identical config/webpack/production.js
identical config/webpack/staging.js
identical config/webpack/test.js
Copying .postcssrc.yml to app root directory
identical .postcssrc.yml
Copying .babelrc to app root directory
identical .babelrc
Installing binstubs
run bundle binstubs webpacker from "."
Skipped webpack and webpack-dev-server since they already exist.
If you want to overwrite skipped stubs, use --force.
append .gitignore
Installing all JavaScript dependencies
run yarn add @rails/webpacker coffeescript@1.12.7 from "."
yarn add v1.13.0
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
[1/4] π Resolving packages...
[2/4] π Fetching packages...
[3/4] π Linking dependencies...
warning " > webpack-dev-server@3.1.14" has unmet peer dependency "webpack@^4.0.0".
warning "webpack-dev-server > webpack-dev-middleware@3.4.0" has unmet peer dependency "webpack@^4.0.0".
warning "@rails/webpacker > postcss-cssnext@3.1.0" has unmet peer dependency "caniuse-lite@^1.0.30000697".
[4/4] π¨ Building fresh packages...
success Saved 1 new dependency.
info Direct dependencies
ββ @rails/webpacker@3.5.5
info All dependencies
ββ @rails/webpacker@3.5.5
β¨ Done in 2.98s.
Installing dev server for live reloading
run yarn add --dev webpack-dev-server from "."
yarn add v1.13.0
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
[1/4] π Resolving packages...
[2/4] π Fetching packages...
[3/4] π Linking dependencies...
warning "@rails/webpacker > postcss-cssnext@3.1.0" has unmet peer dependency "caniuse-lite@^1.0.30000697".
warning "webpack-dev-server > webpack-dev-middleware@3.4.0" has unmet peer dependency "webpack@^4.0.0".
warning " > webpack-dev-server@3.1.14" has unmet peer dependency "webpack@^4.0.0".
[4/4] π¨ Building fresh packages...
success Saved 1 new dependency.
info Direct dependencies
ββ webpack-dev-server@3.1.14
info All dependencies
ββ webpack-dev-server@3.1.14
β¨ Done in 2.58s.
Webpacker successfully installed π π°
exist app/javascript
identical app/javascript/packs/application.js
identical app/javascript/packs/theme.scss
identical app/javascript/src/jets/crud.js
visinote/jets_demo/demo on ξ master [!?] took 19s
[I] β ls
Gemfile Gemfile.lock Procfile README.md Rakefile app bin config config.ru db public spec tmp```
yeah, it was some sort of node env setting, but it's unknown what the issue was. I created a new dir in my home (~
) dir and installed and everything worked fine.
Hi @tsabat, I am experiencing the same issue.
I would be very thankful if you could clarify the following: "I created a new dir in my home (~) dir and installed and everything worked fine."
1) What dir did you create in your home ? 2) what did you installed in there ?
Thank you
Checklist
jets upgrade
command that makes this a simple task. There's also an Upgrading Guide: http://rubyonjets.com/docs/upgrading/My Environment
Expected Behaviour
When i run
I'd expect a package.json to be created. It is not. This example project has one that's created on the "first commit".
Current Behavior
jets skips the
package.json
creation.So, when you run the server, you get an error looking for
node_modules/.bin/webapcker
Step-by-step reproduction instructions
Solution Suggestion
Maybe a new version has stopped creating this file?