Skip to content
New issue

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

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

Already on GitHub? # to your account

npm command not found #551

Closed
Eotel opened this issue Oct 5, 2021 · 0 comments · Fixed by #562
Closed

npm command not found #551

Eotel opened this issue Oct 5, 2021 · 0 comments · Fixed by #562

Comments

@Eotel
Copy link

Eotel commented Oct 5, 2021

Issue Description

It did not work in my environment, but with some modifications to the recipe, it now works. At least it works now, but probably not a fundamental fix. Does anyone know the correct way to handle this ?
Since it is a certificate-related error, it might be related to Issue #12 and #66, but I couldn't figure it out.

The following files have been changed

  • /metasploitable3/chef/cookbooks/metasploitable/recipes/phpmyadmin.rb
  • /metasploitable3/chef/cookbooks/metasploitable/recipes/chatbot.rb

phpmyadmin.rb

# before
wget -c -t 3 -O /tmp/phpMyAdmin-3.5.8-all-languages.tar.gz https://files.phpmyadmin.net/phpMyAdmin/3.5.8/phpMyAdmin-3.5.8-all-languages.tar.gz

# after (add '--no-check-certificate')
wget -c -O /tmp/phpMyAdmin-3.5.8-all-languages.tar.gz --no-check-certificate https://files.phpmyadmin.net/phpMyAdmin/3.5.8/phpMyAdmin-3.5.8-all-languages.tar.gz

chatbot.rb

# before
bash "Install dependencies" do
  code <<-EOH
    npm install express
    npm install cors
    npm config set strict-ssl true
  EOH
end

# after
bash "Install dependencies" do
  code <<-EOH
    DEBIAN_FRONTEND=noninteractive apt-get install -y npm
    npm config set strict-ssl false
    npm install express
    npm install cors
    npm config set strict-ssl true
  EOH
end

Host System

  • OS: MacOS 11.6
  • Packer Version: v1.7.6
  • Vagrant Version: 2.2.18
  • VirtualBox Version: v6.1.26
  • Parallels Version: v17.0.1

Command Output

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

Successfully merging a pull request may close this issue.

1 participant